diff --git a/BUILD.gn b/BUILD.gn index 8e540d8d12240f4dfe4c835b722e51e6f9e6007e..1f9be2bb19e3822ae1d278d42d6eed5c59286e38 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -15,7 +15,7 @@ import("//build/ohos.gni") import("./configure_copts.gni") action("abseil_cpp_action") { - if (is_mac || is_ios) { + if (host_os == "mac") { script = "//third_party/abseil-cpp/install_no_lock.sh" } else { script = "//third_party/abseil-cpp/install.sh" diff --git a/fix-mac-complier-error.patch b/fix-mac-complier-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..9f0b7e8933517281b233e6561cb5e34dd32433f6 --- /dev/null +++ b/fix-mac-complier-error.patch @@ -0,0 +1,17 @@ +diff -uprN a/absl/base/options.h b/absl/base/options.h +--- a/absl/base/options.h 2025-02-03 23:50:45.000000000 +0800 ++++ b/absl/base/options.h 2025-07-02 17:13:16.118136800 +0800 +@@ -173,9 +173,11 @@ + // User code should not inspect this macro. To check in the preprocessor if + // absl::variant is a typedef of std::variant, use the feature macro + // ABSL_USES_STD_VARIANT. +- ++#if defined(ARK_UI_X) ++#define ABSL_OPTION_USE_STD_VARIANT 0 ++#else + #define ABSL_OPTION_USE_STD_VARIANT 2 +- ++#endif + // ABSL_OPTION_USE_STD_ORDERING + // + // This option controls whether absl::{partial,weak,strong}_ordering are diff --git a/install.sh b/install.sh index 48e62b9ce645287eb1a282c4883c859d605beea1..1935fff53d6ba789210d6654278dcd0a64816110 100755 --- a/install.sh +++ b/install.sh @@ -17,6 +17,7 @@ tar zxvf $2/abseil-cpp-20250127.0.tar.gz mv abseil-cpp-20250127.0 abseil-cpp cd abseil-cpp patch -p1 < $2/fix-mingw-complier-error.patch +patch -p1 < $2/fix-mac-complier-error.patch flock -u 100 } 100<>lock_file.lock exit 0 \ No newline at end of file diff --git a/install_no_lock.sh b/install_no_lock.sh index ff999fb7e738e13e4d09a3aad4f5c811a590c56d..11a0be95d2feb282581068f2763d59d0e58f7eb7 100755 --- a/install_no_lock.sh +++ b/install_no_lock.sh @@ -15,4 +15,5 @@ tar zxvf $2/abseil-cpp-20250127.0.tar.gz mv abseil-cpp-20250127.0 abseil-cpp cd abseil-cpp patch -p1 < $2/fix-mingw-complier-error.patch +patch -p1 < $2/fix-mac-complier-error.patch exit 0