aconfig: create c++ interlop from rust flag apis
Using cxx to generate c++ code for the apis that are marked to exported
in the ffi mod in src/lib.rs. For generated code simplicity, it returns
a new flag struct for each rust api.
Create a cc_library to wrap around generated c++ code. See the created
aconfig_storage.hpp for the exported header. Note there is a nested
aconfig_storage::test_only_api namespace, where we place test only apis.
The production apis are placed under aconfig_storage namespace.
Bug: 321077378
Test: m libaconfig_storage_cc
Change-Id: I73a85a26d3749908abc461362f5e0bfc3f85bf4d
diff --git a/tools/aconfig/aconfig_storage_file/build.rs b/tools/aconfig/aconfig_storage_file/build.rs
index 1feeb60..894b71c 100644
--- a/tools/aconfig/aconfig_storage_file/build.rs
+++ b/tools/aconfig/aconfig_storage_file/build.rs
@@ -14,4 +14,7 @@
.inputs(proto_files)
.cargo_out_dir("aconfig_storage_protos")
.run_from_script();
+
+ let _ = cxx_build::bridge("src/lib.rs");
+ println!("cargo:rerun-if-changed=src/lib.rs");
}