]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix to restrict `SystemConfiguration` to macOS
authorViktor Szakats <commit@vsz.me>
Sun, 3 Aug 2025 20:14:02 +0000 (22:14 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 3 Aug 2025 21:35:28 +0000 (23:35 +0200)
Also fix indentation and tidy up to use `STREQUAL` when checking for
Darwin.

Reported-by: Waldemar Kornewald
Fixes #18149
Regression from 739ef9804d8e1e9b4a8d2a610896babc62c5524b #13713
Closes #18153

CMakeLists.txt
m4/curl-sysconfig.m4

index 7e3cfff3ce6809f6a71188b809ff2e8323ce8f10..c12d2bcc18320e876ab7002f108e828b47a377b9 100644 (file)
@@ -355,7 +355,7 @@ if(WIN32)
 endif()
 
 # Override to force-disable or force-enable the use of pkg-config.
-if((UNIX AND NOT ANDROID AND (NOT APPLE OR CMAKE_SYSTEM_NAME MATCHES "Darwin")) OR
+if((UNIX AND NOT ANDROID AND (NOT APPLE OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")) OR
    VCPKG_TOOLCHAIN OR
    (MINGW AND NOT CMAKE_CROSSCOMPILING))
   set(_curl_use_pkgconfig_default ON)
@@ -653,7 +653,7 @@ if(ENABLE_IPV6)
       set(ENABLE_IPV6 OFF CACHE BOOL "Enable IPv6 support" FORCE)  # Force the feature off as we use this name as guard macro
     endif()
 
-    if(APPLE AND NOT ENABLE_ARES)
+    if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT ENABLE_ARES)
       set(_use_core_foundation_and_core_services ON)
 
       find_library(SYSTEMCONFIGURATION_FRAMEWORK NAMES "SystemConfiguration")
index 3215e7d3dbb9a884e22acad02536da1258ae17be..f5ebe0391b20226de88406a8b1aadc28c3eacbdc 100644 (file)
@@ -32,7 +32,7 @@ AC_MSG_CHECKING([whether to link macOS CoreFoundation, CoreServices, and SystemC
       #if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
         return 0;
       #else
-      #error Not macOS
+        #error Not macOS
       #endif
     ]])
   ],[