Skip to content

Commit

Permalink
cmake: set default CMAKE_OSX_DEPLOYMENT_TARGET before project()
Browse files Browse the repository at this point in the history
project() appears to set it to an empty string (the value of nonexistent
$ENV{MACOSX_DEPLOYMENT_TARGET}?), causing our attempt to set its default
to fail. CMake bug?
  • Loading branch information
nadiaholmquist committed Dec 5, 2024
1 parent 817b409 commit 7d718ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/DefaultBuildFlags.cmake")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")

option(USE_VCPKG "Use vcpkg for dependency packages" OFF)
if (USE_VCPKG)
Expand All @@ -29,8 +30,6 @@ include(CheckIPOSupported)
include(SetupCCache)
include(Sanitizers)

set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
Expand Down
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@
libtool
ninja
pkg-config
python3
];

# Undo the SDK setup done by nixpkgs so we can use AppleClang
shellHook = ''
unset DEVELOPER_DIR SDKROOT MACOSX_DEPLOYMENT_TARGET
'';
};
};
}
Expand Down

0 comments on commit 7d718ad

Please sign in to comment.