summaryrefslogtreecommitdiff
path: root/build_extra/rust/BUILD.gn
diff options
context:
space:
mode:
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" ]
+ }
+}