Issue building swift on MacOS - CMAKE_OSX_SYSROOT pointing to SDK that I don't have installed


I haven't built swift for a while and wanted to do the full toolchain build locally, so I wiped everything out and went through the process described in GettingStarted.

The checkout worked great, everything updated - but when I try to do a basic build, both with Ninja and Xcode, I run into failures as the code appears to be looking for the 11.3 macOS SDK - but that doesn't exist in the current release of Xcode.

In particular, I receive a prominent CMake warning:

  Ignoring CMAKE_OSX_SYSROOT value:


and then the error:

CMake Error at /opt/homebrew/Cellar/cmake/3.21.4/share/cmake/Modules/FindSQLite3.cmake:45 (file):
  file STRINGS file
  cannot be read.
Call Stack (most recent call first):
  CMakeLists.txt:29 (find_package)

Looking at my filesystem — with Xcode Version 13.1 (13A1030d) — the only macOS SDK that's included is MacOSX12.0.sdk

Without knowing how to set the appropriate CMake variables through, I tried setting an environment variable with the same name to the SDK that I do have:
export CMAKE_OSX_SYSROOT=/Applications/, but that didn't appear to get picked up by the build scripts and/or CMake.

(cmake is version 3.21.4, installed from homebrew - along with Ninja and SCCache per the suggestions in getting started)

What's the best way to get the right SDK location into place so that the relevant tooling can find the appropriate headers?

Terms of Service

Privacy Policy

Cookie Policy