From d81d8c18dbc7b4d16d37b3cb4221104f1d9217c3 Mon Sep 17 00:00:00 2001 From: YX Date: Mon, 2 Nov 2026 07:56:37 +0800 Subject: [PATCH] fix(macos): link ServiceManagement weakly for macOS 12 ## Problem On macOS 12 the built `cnativeapi` library fails to load: --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e0ad5a..8f170c7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -101,7 +101,7 @@ elseif(APPLE) target_link_libraries(nativeapi PUBLIC "-framework QuartzCore") target_link_libraries(nativeapi PUBLIC "-framework Carbon") target_link_libraries(nativeapi PUBLIC "-framework IOKit") - target_link_libraries(nativeapi PUBLIC "-framework ServiceManagement") + target_link_libraries(nativeapi PUBLIC "-weak_framework ServiceManagement") target_compile_options(nativeapi PRIVATE "-x" "objective-c++") elseif(CMAKE_SYSTEM_NAME STREQUAL "OHOS") # Full Preferences enumeration/flush requires API 23; display queries use