diff --git a/BUILD.gn b/BUILD.gn index bea2f299ff3a4ea5f1575ec3cfe9cba0bae8d22f..6879d3f4ec1945aef75476e62bdb5a4b005f9058 100755 --- a/BUILD.gn +++ b/BUILD.gn @@ -182,6 +182,8 @@ ohos_source_set("ace_napi_static") { external_deps += [ "ace_engine:ace_container_scope" ] defines += [ "ENABLE_CONTAINER_SCOPE_SEND_EVENT" ] } + } else if (is_mac) { + external_deps += [ "runtime_core:libarkbase_static" ] } # Use static libuv and icu for cross build @@ -206,7 +208,11 @@ ohos_source_set("ace_napi_static") { } } - cflags_cc = [ "-Wno-missing-braces" ] + if (is_mac) { + cflags_cc = [ "-Wno-missing-braces", "-Wno-vla-extension" ] + } else { + cflags_cc = [ "-Wno-missing-braces" ] + } if (ark_standalone_build && (is_debug || (defined(is_fastverify) && is_fastverify))) { cflags_cc += [ diff --git a/native_engine/native_async_work.cpp b/native_engine/native_async_work.cpp index edd087dd1ae2bbbd59df485dc9de84a429aee892..189f949b98794433cf77a76f58156d5880544e5f 100644 --- a/native_engine/native_async_work.cpp +++ b/native_engine/native_async_work.cpp @@ -46,8 +46,13 @@ NativeAsyncWork::NativeAsyncWork(NativeEngine* engine, NativeAsyncCompleteCallback complete, const std::string &asyncResourceName, void* data) - : work_({ 0 }), engine_(engine), engineId_(engine->GetId()), execute_(execute), complete_(complete), data_(data) + : engine_(engine), engineId_(engine->GetId()), execute_(execute), complete_(complete), data_(data) { +#ifdef PANDA_TARGET_MACOS + work_ = {}; +#else + work_ = { 0 }; +#endif work_.data = this; (void)asyncResourceName; #ifdef ENABLE_HITRACE diff --git a/native_engine/native_engine.h b/native_engine/native_engine.h index 5dc5d7477b97252068b76efc8c8feb0c97e5166b..821772a48121da20610f5c3a8894717057517887 100644 --- a/native_engine/native_engine.h +++ b/native_engine/native_engine.h @@ -356,7 +356,7 @@ public: void Increase##name##Counter(); \ void Decrease##name##Counter(); \ bool Has##name(); - NAPI_COUNTER_METHOD(DCL_COUNTER_METHOD); + NAPI_COUNTER_METHOD(DCL_COUNTER_METHOD) #undef DCL_COUNTER_METHOD // alias for HasListening bool HasListeningCounter(); diff --git a/utils/log.h b/utils/log.h index 4555d43525119d75fc830b3843435e24c63effa6..7c324fdd87949e043bffb946c03cb95a062ca5f5 100644 --- a/utils/log.h +++ b/utils/log.h @@ -26,6 +26,12 @@ #define __FILENAME__ strrchr(__FILE__, '/') + 1 +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#elif defined(__GNUC__) || defined(__GNUG__) +#pragma GCC diagnostic ignored "-Wgnu-zero-variadic-macro-arguments" +#endif + #if defined(MAC_PLATFORM) || defined(WINDOWS_PLATFORM) || defined(ANDROID_PLATFORM) || defined(IOS_PLATFORM) || \ defined(LINUX_PLATFORM) enum class LogLevel : uint32_t {