-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Closed
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.6.topic: darwinRunning or building packages on DarwinRunning or building packages on Darwin
Description
In 68513e4 (part of #77632) CMAKE_OSX_ARCHITECTURES=x86_64 was moved from pkgs/stdenv/darwin/default.nix to pkgs/development/tools/build-managers/cmake/setup-hook.sh. As a result -DCMAKE_OSX_ARCHITECTURES=x86_64 is since then set on Linux as well.
Until now this wasn't a problem as https://cmake.org/cmake/help/v3.18/variable/CMAKE_OSX_ARCHITECTURES.html states that:
This variable is ignored on platforms other than Apple.
Unfortunately that behaviour changed in CMake 3.18:
- Nixpkgs issue: Some builds fail with invalid gcc flag "-Xarch_x86_64" (Linux+CMake+PCH) #94905
- CMake issue: https://gitlab.kitware.com/cmake/cmake/-/issues/21072
To avoid such regressions in the future it might be a good idea to set the following two CMake flags (source) only on Darwin:
# on macOS i686 was only relevant for 10.5 or earlier.
cmakeFlags="-DCMAKE_OSX_ARCHITECTURES=x86_64 $cmakeFlags"
# we never want to use the global macOS SDK
cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags"
cc CMake maintainers: @ttuegel @LnL7
cc @orivej (found this regression)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.6.topic: darwinRunning or building packages on DarwinRunning or building packages on Darwin