Experiment with static libs
Change-Id: I55c1e43690defae6a615253eeca38da1872fc050
diff --git a/rust/rustc_artifact.gni b/rust/rustc_artifact.gni
index 468ba17..ee943df 100644
--- a/rust/rustc_artifact.gni
+++ b/rust/rustc_artifact.gni
@@ -218,6 +218,19 @@
public_deps = invoker.non_rust_deps
}
+ if (defined(invoker.static_libs)) {
+ print("static_libs", invoker.static_libs)
+ foreach(one_dep, invoker.static_libs) {
+ out_dir = rebase_path(get_label_info(one_dep, "target_out_dir"), "")
+ print("out_dir", out_dir)
+ dep_name = get_label_info(one_dep, "name")
+ print("dep_name", dep_name)
+ dep_name = get_label_info(one_dep, "name")
+ print("dep_name", dep_name)
+ print("lib_name", "lib${dep_name}.a")
+ }
+ }
+
out_info_path = "${target_out_dir}/${target_name}_info.json"
args = [
diff --git a/rust/rustc_binary.gni b/rust/rustc_binary.gni
index be51c8f..460653a 100644
--- a/rust/rustc_binary.gni
+++ b/rust/rustc_binary.gni
@@ -23,6 +23,9 @@
# non_rust_deps (optional)
# List of non-rust_library GN targets on which this crate depends.
#
+# static_libs (optional)
+# List of static lib GN targets on which this crate depends.
+#
# with_unit_tests (optional)
# Builds unit tests associated with the binary. This will create a
# `<name>-bin-unit-test` test file in the output directory.
@@ -60,6 +63,7 @@
"version",
"deps",
"non_rust_deps",
+ "static_libs",
"with_unit_tests",
"output_name",
"source_root",