Skip to content

Commit

Permalink
鸿蒙的10.6的use_custom_libcxx=true支持
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Aug 15, 2024
1 parent a100412 commit eabb60d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions patches/ohos_build_v10.6.194.patch
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,14 @@ index fb21f2b51..aa9536a09 100644
} else {
declare_args() {
diff --git a/config/c++/c++.gni b/config/c++/c++.gni
index 4d8e4853a..a128cb867 100644
index 4d8e4853a..120cd00fd 100644
--- a/config/c++/c++.gni
+++ b/config/c++/c++.gni
@@ -45,6 +45,11 @@ use_custom_libcxx =
@@ -45,6 +45,10 @@ use_custom_libcxx =
use_custom_libcxx || (use_custom_libcxx_for_host && !is_a_target_toolchain)
use_custom_libcxx = use_custom_libcxx && !is_nacl

+if (is_ohos) {
+ use_custom_libcxx = false
+ use_custom_libcxx_for_host = false
+}
+
Expand Down Expand Up @@ -597,10 +596,10 @@ index 5550eecf1..c81ce2257 100644
} else if (is_chromeos_device) {
diff --git a/config/ohos/BUILD.gn b/config/ohos/BUILD.gn
new file mode 100644
index 000000000..1f63ffd5a
index 000000000..9c995b941
--- /dev/null
+++ b/config/ohos/BUILD.gn
@@ -0,0 +1,303 @@
@@ -0,0 +1,306 @@
+# Copyright 2022 The Huawei Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
Expand Down Expand Up @@ -693,11 +692,14 @@ index 000000000..1f63ffd5a
+
+ if (use_musl) {
+ cflags += [ "--target=$abi_target" ]
+ include_dirs = [ "$ohos_toolchain_root/include/libcxx-ohos/include/c++/v1" ]
+ if (use_custom_libcxx) {
+ include_dirs = [ "$ohos_sysroot/usr/include/$abi_target" ]
+ } else {
+ include_dirs = [ "$ohos_toolchain_root/include/libcxx-ohos/include/c++/v1", "$ohos_sysroot/usr/include" ]
+ }
+ if (current_cpu == "x64") {
+ include_dirs += [ "$ohos_sysroot/usr/include/x86_64-linux-ohos/asm-x86" ]
+ }
+ include_dirs += [ "$ohos_sysroot/usr/include" ]
+ ldflags += [ "--target=$abi_target" ]
+ } else {
+ cflags += [
Expand Down

0 comments on commit eabb60d

Please sign in to comment.