From 11cf9e99f28e6ab0005c53508d24f1134dd3cace Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Tue, 6 May 2025 12:45:49 -0700 Subject: [PATCH] Add fix to support CMake 4.0, plus update Spicy to version that supports it --- CMakeLists.txt | 16 ++++++++++++++++ auxil/spicy | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c4c7aa9990..0b4ba49197 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,22 @@ if (WIN32) set(CMAKE_TOOLCHAIN_FILE ${_toolchain} CACHE STRING "Vcpkg toolchain file") endif () +if (APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL 4.0.0 AND NOT CMAKE_OSX_SYSROOT) + # Spicy needs having CMAKE_OSX_SYSROOT point to the macOS SDK + # path, but starting with CMake 4.0 CMAKE_OSX_SYSROOT is not set + # automatically anymore. So we follow the guidance from the CMake 4.0 + # release notes here: + # + # Builds targeting macOS no longer choose any SDK or pass an "-isysroot" + # flag to the compiler by default. [...] users must now specify + # "-DCMAKE_OSX_SYSROOT=macosx" when configuring their build. + # + # Note that this needs to happen before the project() call below, meaning + # we cannot rely on the corresponding code inside the Spicy CMake + # configuration. + set(CMAKE_OSX_SYSROOT "macosx") +endif () + project(Zeek C CXX) # We want to set ENABLE_DEBUG to ON by default if the build type is Debug. diff --git a/auxil/spicy b/auxil/spicy index 31880e215f..c6c2809e89 160000 --- a/auxil/spicy +++ b/auxil/spicy @@ -1 +1 @@ -Subproject commit 31880e215ff6f85ad95507d7a760e81ae2e0999d +Subproject commit c6c2809e89ed9329a5ef1f43e2a6c821fa3dd5b5