Swift: add flags and instructions for building on macOS ARM

This commit is contained in:
Paolo Tranquilli
2024-05-23 10:44:06 +02:00
parent 11da42b049
commit 90a152a2bc
2 changed files with 10 additions and 2 deletions

View File

@@ -11,7 +11,8 @@ common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
build --repo_env=CC=clang --repo_env=CXX=clang++
build:linux --cxxopt=-std=c++20
build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64
# we currently cannot built the swift extractor for ARM
build:macos --cxxopt=-std=c++20 --copt=-arch --copt=x86_64 --linkopt=-arch --linkopt=x86_64
build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor
# this requires developer mode, but is required to have pack installer functioning

View File

@@ -16,7 +16,14 @@ brew install bazelisk
then from the `ql` directory run
```bash
bazel run //swift:create-extractor-pack # --cpu=darwin_x86_64 # Uncomment on Arm-based Macs
bazel run //swift:create-extractor-pack
```
If you are running on macOS and you encounter errors mentioning `XXX is unavailable: introduced in macOS YY.ZZ`,
you will need to run this from the root of your `codeql` checkout:
```bash
echo common --macos_sdk_version=$(sw_vers --productVersion) >> local.bazelrc
```
which will install `swift/extractor-pack`.