From a23276f1edefc9ce458af41341cd5944c29cec5b Mon Sep 17 00:00:00 2001 From: peilixia Date: Thu, 27 Jul 2023 17:25:58 +0800 Subject: [PATCH] Cross-platform compilation adaptation for OpenHarmony-4.0-Beta2. Issue:I7OJBT Test:NA Signed-off-by: peilixia --- base/BUILD.gn | 12 +++++++----- base/test/BUILD.gn | 2 +- base/test/unittest/rust/BUILD.gn | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/base/BUILD.gn b/base/BUILD.gn index 338aafb..1e0ea91 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -150,9 +150,11 @@ ohos_shared_library("utils") { sources = sources_utils configs = [ ":utils_coverage_config" ] - if (c_utils_feature_intsan) { - sanitize = { - integer_overflow = true + if (!build_cross_platform_version) { + if (c_utils_feature_intsan) { + sanitize = { + integer_overflow = true + } } } @@ -186,7 +188,7 @@ ohos_shared_library("utils") { ########## modules for `c_utils` in rust ########## # rust compiler is not supportted on mac -if (host_os == "linux" && !is_asan) { +if (host_os == "linux" && !is_asan && !build_cross_platform_version) { import("//build/templates/rust/rust_cxx.gni") # used for templates rust_cxx() rust_cxx("cxx_rust_gen") { sources = [ @@ -247,7 +249,7 @@ if (host_os == "linux" && !is_asan) { group("utils_rust") { public_deps = [] - if (host_os == "linux" && !is_asan) { + if (host_os == "linux" && !is_asan && !build_cross_platform_version) { public_deps += [ ":utils_rs" ] } } diff --git a/base/test/BUILD.gn b/base/test/BUILD.gn index c44dea1..2368aac 100644 --- a/base/test/BUILD.gn +++ b/base/test/BUILD.gn @@ -20,7 +20,7 @@ group("unittest") { deps += [ "unittest/common:unittest" ] # rust compiler is not supportted on mac - if (host_os == "linux" && !is_asan) { + if (host_os == "linux" && !is_asan && !build_cross_platform_version) { deps += [ "unittest/rust:unittest" ] } } diff --git a/base/test/unittest/rust/BUILD.gn b/base/test/unittest/rust/BUILD.gn index e5a1266..8353fcd 100644 --- a/base/test/unittest/rust/BUILD.gn +++ b/base/test/unittest/rust/BUILD.gn @@ -13,7 +13,7 @@ import("//build/ohos.gni") import("//build/test.gni") -if (host_os == "linux" && !is_asan) { +if (host_os == "linux" && !is_asan && !build_cross_platform_version) { config("module_private_config") { visibility = [ ":*" ] -- Gitee