diff --git a/BUILD.gn b/BUILD.gn index 3011439fe1db7a168b70cc6f6abbfbdedb1b0de4..ae8ceabe18f2c7f385d733ebaaa3162a198ef3a1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -24,13 +24,15 @@ ohos_cargo_crate("lib") { cargo_pkg_authors = "David Tolnay " cargo_pkg_name = "cxx" cargo_pkg_description = "Safe interop between Rust and C++" - deps = [ "//third_party/rust/crates/cxx/macro:lib(${host_toolchain})" ] + deps = [ "//third_party/rust/crates/cxx/macro:macro_lib(${host_toolchain})" ] features = [ "alloc", "std", ] build_root = "build.rs" build_sources = [ "build.rs" ] + part_name = "rust_cxx" + subsystem_name = "thirdparty" } config("cxx_cppdeps_header_config") { @@ -52,4 +54,6 @@ ohos_static_library("cxx_cppdeps") { } else { defines += [ "CXX_RS_EXPORT=__attribute__((visibility(\"default\")))" ] } + part_name = "rust_cxx" + subsystem_name = "thirdparty" } diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000000000000000000000000000000000000..5f060a33fe357eaa0ad5db9d9bd9362a47fcecd6 --- /dev/null +++ b/bundle.json @@ -0,0 +1,44 @@ +{ + "name": "@ohos/rust_cxx", + "description": "safe FFI between Rust and C++", + "version": "5.0", + "license": "Apache License 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "third_party/rust/crates/cxx" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "rust_cxx", + "subsystem": "thirdparty", + "adapted_system_type": [ + "standard" + ], + "deps": { + "components": [ + "rust_proc_macro2", + "rust_quote", + "rust_syn" + ] + }, + "build": { + "sub_component": [], + "inner_kits": [ + { + "name": "//third_party/rust/crates/cxx:cxx_cppdeps" + }, + { + "name": "//third_party/rust/crates/cxx:lib" + }, + { + "name": "//third_party/rust/crates/cxx/macro:macro_lib" + }, + { + "name": "//third_party/rust/crates/cxx/gen/cmd:cxxbridge" + } + ], + "test": [] + } + } + } \ No newline at end of file diff --git a/gen/cmd/BUILD.gn b/gen/cmd/BUILD.gn index 8962c6df28d204bbf3e203bcba72a12a1db6ce46..de28c016918d3e5ffeb6050b53b8fdecd4e0ef55 100644 --- a/gen/cmd/BUILD.gn +++ b/gen/cmd/BUILD.gn @@ -31,4 +31,6 @@ ohos_cargo_crate("cxxbridge") { "//third_party/rust/crates/quote:lib", "//third_party/rust/crates/syn:lib", ] + part_name = "rust_cxx" + subsystem_name = "thirdparty" } diff --git a/macro/BUILD.gn b/macro/BUILD.gn index d98f35a6d7d890c88e0c7a2d4bd247e77def8e82..4387dc93a05a9db518eff0badb418b406e9a1738 100644 --- a/macro/BUILD.gn +++ b/macro/BUILD.gn @@ -13,7 +13,7 @@ import("//build/ohos.gni") -ohos_cargo_crate("lib") { +ohos_cargo_crate("macro_lib") { crate_name = "cxxbridge_macro" crate_type = "proc-macro" visibility = [ "//third_party/rust/crates/*" ] @@ -30,4 +30,8 @@ ohos_cargo_crate("lib") { "//third_party/rust/crates/quote:lib", "//third_party/rust/crates/syn:lib", ] + build_root = "build.rs" + build_sources = [ "build.rs" ] + part_name = "rust_cxx" + subsystem_name = "thirdparty" }