diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 09:15:40 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 09:15:40 +0000 |
| commit | ce584238e66a32f93c1af4d16bfe4a1928e25b88 (patch) | |
| tree | a3b91ec06761d16a85ac45ca876f9610d597c867 /doc | |
| parent | b439592cf8113f34240095dcd6d8b6196c7d87c7 (diff) | |
fix(build): select the macOS SDK before compiler detection
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/build.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/build.md b/doc/build.md index 7f702d3..17f2741 100644 --- a/doc/build.md +++ b/doc/build.md @@ -161,6 +161,8 @@ sh tools/build-static-lld.sh "$(brew --prefix llvm@23)" "$PWD/build" 3 The helper downloads the matching official LLVM source release, extracts LLD, its common CMake utilities and libunwind's Mach-O headers, and builds LLD using the installed LLVM SDK. It installs static LLD libraries, headers, tools and CMake configuration into `build/`, where cpsc's local dependency lookup finds them before system packages. It does not rebuild LLVM or libunwind. Use the same build directory for the helper and cpsc. For an already-extracted LLVM bottle, pass its `build/deps/root/opt/llvm` prefix instead; the LLVM versions must match. The helper uses the host architecture and defaults to a macOS 15.0 deployment target; set `MACOSX_DEPLOYMENT_TARGET` to override that target for both builds. +Both builds explicitly select the active SDK with `CMAKE_OSX_SYSROOT`. This lets CMake recognize SDK headers as implicit compiler includes, keeping C library headers behind libc++'s wrapper headers when imported libraries such as zlib expose the SDK include directory. + ## Build You must explicitly choose `-DCPSC_RUN_MODE=PATH`, `EMBEDDED`, or `NONE` on @@ -200,6 +202,7 @@ macOS: ```bash cmake -S . -B build -DCPSC_RUN_MODE=EMBEDDED -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_OSX_SYSROOT="$(xcrun --show-sdk-path)" \ -DCMAKE_C_COMPILER="$PWD/build/deps/root/opt/llvm/bin/clang" \ -DCMAKE_CXX_COMPILER="$PWD/build/deps/root/opt/llvm/bin/clang++" cmake --build build -j4 |
