mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 13:35:12 +00:00
CMake: Explicitly set CMAKE_OSX_SYSROOT to macosx for macOS host builds
The implicit default CMAKE_OSX_SYSROOT was a workaround in CMake for macOS ~10.8. As of CMake 4.x, CMake expects macOS host compilers to have their own default sysroot detection logic. However, upstream llvm does not actually do this, only Apple Clang does. To keep supporting homebrew clang and manually compiled clang from llvm/llvm-project, we need to set the sysroot explicitly. The behavior difference and lack of default detection logic in the clang driver is tracked at https://gitlab.kitware.com/cmake/cmake/-/issues/26863
This commit is contained in:
parent
981e465a04
commit
e1369aa7d6
Notes:
github-actions[bot]
2025-04-22 21:32:16 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/e1369aa7d65 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4420 Reviewed-by: https://github.com/trflynn89 ✅
5 changed files with 10 additions and 1 deletions
|
@ -15,6 +15,10 @@ if (CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg.cmake$")
|
|||
set(CMAKE_PROJECT_ladybird_INCLUDE_BEFORE "Meta/CMake/vcpkg/generate_vcpkg_toolchain_variables.cmake")
|
||||
endif()
|
||||
|
||||
if (APPLE AND NOT CMAKE_OSX_SYSROOT)
|
||||
set(CMAKE_OSX_SYSROOT macosx)
|
||||
endif()
|
||||
|
||||
project(ladybird
|
||||
VERSION 0.1.0
|
||||
LANGUAGES C CXX
|
||||
|
|
|
@ -2,5 +2,6 @@ set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
|||
set(VCPKG_TARGET_ARCHITECTURE arm64)
|
||||
set(VCPKG_OSX_ARCHITECTURES arm64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_OSX_SYSROOT macosx)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/base.cmake)
|
||||
|
|
|
@ -2,5 +2,6 @@ set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
|
|||
set(VCPKG_TARGET_ARCHITECTURE x64)
|
||||
set(VCPKG_OSX_ARCHITECTURES x86_64)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
set(VCPKG_OSX_SYSROOT macosx)
|
||||
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/base.cmake)
|
||||
|
|
|
@ -60,7 +60,6 @@ cmake -GNinja --preset=Distribution -B Build/tools \
|
|||
-DCMAKE_INSTALL_PREFIX=Build/tool-install \
|
||||
-DCMAKE_C_COMPILER=$BEST_CLANG_CANDIDATE \
|
||||
-DCMAKE_CXX_COMPILER="${BEST_CLANG_CANDIDATE/clang/clang++}" \
|
||||
-DCMAKE_OSX_SYSROOT=macosx \
|
||||
-Dpackage=LagomTools
|
||||
ninja -C Build/tools install
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
cmake_minimum_required (VERSION 3.21)
|
||||
|
||||
if (APPLE AND NOT CMAKE_OSX_SYSROOT)
|
||||
set(CMAKE_OSX_SYSROOT macosx)
|
||||
endif()
|
||||
|
||||
project(
|
||||
Lagom
|
||||
VERSION 0.0.0
|
||||
|
|
Loading…
Add table
Reference in a new issue