From 9644647a31440b424d49ca6ad8b752b8bfc37a36 Mon Sep 17 00:00:00 2001 From: Luming Date: Fri, 17 Jan 2025 16:25:57 +0800 Subject: [PATCH] =?UTF-8?q?third=5Fparty=5Frust=5Fcxx=E9=83=A8=E4=BB=B6?= =?UTF-8?q?=E5=8C=96=E6=94=B9=E9=80=A0=20IssueNo=EF=BC=9Ahttps://gitee.com?= =?UTF-8?q?/openharmony/build/issues/IBF1L?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luming --- BUILD.gn | 6 +++++- bundle.json | 44 ++++++++++++++++++++++++++++++++++++++++++++ gen/cmd/BUILD.gn | 2 ++ macro/BUILD.gn | 6 +++++- 4 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 bundle.json diff --git a/BUILD.gn b/BUILD.gn index 3011439f..ae8ceabe 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 00000000..5f060a33 --- /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 8962c6df..de28c016 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 d98f35a6..4387dc93 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" } -- Gitee