From d30664958ec1031a99373414e17c124b4fa468fa Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 6 Jul 2018 00:58:09 -0400 Subject: Further gn/rust cleanups Move rust.gni and deno.gni into build_extra/ Removes rust_library which was only an action. This instead defines rust_component, which is an action plus a gn "component" target to expose the resulting object file. This simplifies link code in rust.gni. Support rust modules that can be linked into C++. --- build_extra/rust/BUILD.gn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 build_extra/rust/BUILD.gn (limited to 'build_extra/rust/BUILD.gn') diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn new file mode 100644 index 000000000..e5a4fec16 --- /dev/null +++ b/build_extra/rust/BUILD.gn @@ -0,0 +1,15 @@ +import("rust.gni") + +# By compiling an empty file as crate-type=staticlib we get all the code +# for the rust stdlib, which are not included in the object file outputs +# of other libs. +rust_component("stdlib") { + crate_type = "staticlib" + source_root = "empty.rs" + if (current_os == "mac") { + libs = [ "resolv" ] + } + if (current_os == "win") { + libs = [ "userenv.lib" ] + } +} -- cgit v1.2.3