From bd835959d4029b79fc7e5127c5dfb84fbd2685e5 Mon Sep 17 00:00:00 2001 From: guzhihao4 Date: Tue, 11 Apr 2023 10:36:38 +0800 Subject: [PATCH] Fix llvm15 build Fix libc++_shared.so absolute path Issue: #I6UE8I Signed-off-by: guzhihao4 Change-Id: Ie2dffe364ec8191a0558d3f5c302d431af39eff6 --- arkui/ace_ets_xcomponent/BUILD.gn | 9 ++------- arkui/ace_napi_test/entry/src/main/cpp/BUILD.gn | 8 +------- .../bundlemanager/actsbundlenativetest/BUILD.gn | 2 +- .../actsbundlenativetest/entry/src/main/cpp/BUILD.gn | 8 +------- global/global_napi_test/entry/src/main/cpp/BUILD.gn | 9 ++------- hiviewdfx/hilogtest/hilogjstest/src/main/cpp/BUILD.gn | 8 +------- .../imagePixelMapNDK/entry/src/main/cpp/BUILD.gn | 9 ++------- .../imageReceiverNDK/entry/src/main/cpp/BUILD.gn | 9 ++------- .../image_ndk_test/entry/src/main/cpp/BUILD.gn | 8 +------- 9 files changed, 13 insertions(+), 57 deletions(-) diff --git a/arkui/ace_ets_xcomponent/BUILD.gn b/arkui/ace_ets_xcomponent/BUILD.gn index 6d2bd32f8..f6f39b114 100644 --- a/arkui/ace_ets_xcomponent/BUILD.gn +++ b/arkui/ace_ets_xcomponent/BUILD.gn @@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import("//build/config/ohos/config.gni") import("//build/ohos.gni") import("//test/xts/tools/build/suite.gni") @@ -31,13 +32,7 @@ ohos_js_hap_suite("ActsAceXComponentEtsTest") { } ohos_prebuilt_shared_library("libcppsharedso") { - if (target_cpu == "arm") { - source = "//prebuilts/clang/ohos/linux-x86_64/libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" - } else if (target_cpu == "arm64") { - source = "//prebuilts/clang/ohos/linux-x86_64/libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" - } else { - source = " " - } + source = rebase_path(libcxx_ndk_shared_file) } ohos_js_assets("ace_ets_xcomponent_assets") { diff --git a/arkui/ace_napi_test/entry/src/main/cpp/BUILD.gn b/arkui/ace_napi_test/entry/src/main/cpp/BUILD.gn index 22b5e758d..23c0887ab 100644 --- a/arkui/ace_napi_test/entry/src/main/cpp/BUILD.gn +++ b/arkui/ace_napi_test/entry/src/main/cpp/BUILD.gn @@ -32,13 +32,7 @@ config("public_config") { ohos_shared_library("napitest") { sources = [ "./napi/napi_test.cpp" ] if (!(product_name == "m40")) { - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] } include_dirs = [ "//test/xts/acts/arkui/ace_napi_test/entry/src/main/cpp" ] diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/BUILD.gn index 257ef6d59..3effa95eb 100755 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/BUILD.gn +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/BUILD.gn @@ -32,7 +32,7 @@ ohos_js_hap_suite("ActsBundleNativeTest") { } ohos_prebuilt_shared_library("libcppsharedso") { - source = "//prebuilts/clang/ohos/linux-x86_64/libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" + source = rebase_path(libcxx_ndk_shared_file) } ohos_js_assets("ace_third_ets_assets") { diff --git a/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/entry/src/main/cpp/BUILD.gn b/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/entry/src/main/cpp/BUILD.gn index 1c447db6e..f9fb5be2f 100755 --- a/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/entry/src/main/cpp/BUILD.gn +++ b/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/entry/src/main/cpp/BUILD.gn @@ -31,13 +31,7 @@ config("public_config") { ohos_shared_library("bundlendk") { sources = [ "./bundlendk.cpp" ] if (!(product_name == "m40")) { - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] } include_dirs = [ "//test/xts/acts/bundlemanager/bundle_standard/bundlemanager/actsbundlenativetest/entry/src/main/cpp" ] diff --git a/global/global_napi_test/entry/src/main/cpp/BUILD.gn b/global/global_napi_test/entry/src/main/cpp/BUILD.gn index dbfd33a2c..597a6214d 100644 --- a/global/global_napi_test/entry/src/main/cpp/BUILD.gn +++ b/global/global_napi_test/entry/src/main/cpp/BUILD.gn @@ -31,13 +31,8 @@ config("public_config") { ohos_shared_library("resmgrndk") { sources = [ "./napi/global_napi_test.cpp" ] - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] + include_dirs = [ "//base/global/resource_management/interfaces/native/resource/include", "//test/xts/acts/arkui/ace_napi_test/entry/src/main/cpp", diff --git a/hiviewdfx/hilogtest/hilogjstest/src/main/cpp/BUILD.gn b/hiviewdfx/hilogtest/hilogjstest/src/main/cpp/BUILD.gn index 410cf985d..ea57de241 100644 --- a/hiviewdfx/hilogtest/hilogjstest/src/main/cpp/BUILD.gn +++ b/hiviewdfx/hilogtest/hilogjstest/src/main/cpp/BUILD.gn @@ -32,13 +32,7 @@ config("public_config") { ohos_shared_library("hilogndk") { sources = [ "./hilogndk.cpp" ] if (!(product_name == "m40")) { - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] } include_dirs = [ diff --git a/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/BUILD.gn b/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/BUILD.gn index d08908f96..f64b9b4fa 100644 --- a/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/BUILD.gn +++ b/multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/BUILD.gn @@ -28,13 +28,8 @@ config("config") { ohos_shared_library("ImagePixelMapNDKTest") { sources = [ "./napi/image_pixel_map_imgndk_test.cpp" ] - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] + include_dirs = [ "../cpp" ] configs = [ ":config" ] diff --git a/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/BUILD.gn b/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/BUILD.gn index 9d6c3f9d6..26a484f24 100644 --- a/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/BUILD.gn +++ b/multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/BUILD.gn @@ -28,13 +28,8 @@ config("config") { ohos_shared_library("ImageReceiverNDKTest") { sources = [ "./napi/image_receiver_mdk_test.cpp" ] - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] + include_dirs = [ "../cpp" ] configs = [ ":config" ] diff --git a/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn b/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn index aff4d0ff8..9c058cf72 100644 --- a/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn +++ b/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn @@ -32,13 +32,7 @@ config("public_config") { ohos_shared_library("imagePixelmap") { sources = [ "./napi/imagePixelmap.cpp" ] if (use_musl) { - if (target_cpu == "arm") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ] - } else if (target_cpu == "arm64") { - libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ] - } else { - libs = [] - } + libs = [ rebase_path(libcxx_ndk_shared_file) ] } include_dirs = [ "//test/xts/acts/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp" ] configs = [ ":config" ] -- GitLab