summaryrefslogtreecommitdiff
path: root/build_extra/rust/BUILD.gn
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-07-06 00:58:09 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-07-06 10:46:30 -0400
commitd30664958ec1031a99373414e17c124b4fa468fa (patch)
tree23efb7d8dbb4208f4d77732e7a91dff7842b97fb /build_extra/rust/BUILD.gn
parentbfe08aa4629ee2834ac5c7eaea4db164db1e66ae (diff)
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++.
Diffstat (limited to 'build_extra/rust/BUILD.gn')
-rw-r--r--build_extra/rust/BUILD.gn15
1 files changed, 15 insertions, 0 deletions
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" ]
+ }
+}