Skip to content

Commit 7da7416

Browse files
authored
Merge pull request github#16568 from github/redsun82/m1-opts
Swift: add flags and instructions for building on macOS ARM
2 parents 5cf7112 + 90a152a commit 7da7416

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.bazelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
1111
build --repo_env=CC=clang --repo_env=CXX=clang++
1212

1313
build:linux --cxxopt=-std=c++20
14-
build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64
14+
# we currently cannot built the swift extractor for ARM
15+
build:macos --cxxopt=-std=c++20 --copt=-arch --copt=x86_64 --linkopt=-arch --linkopt=x86_64
1516
build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor
1617

1718
# this requires developer mode, but is required to have pack installer functioning

swift/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ brew install bazelisk
1616
then from the `ql` directory run
1717

1818
```bash
19-
bazel run //swift:create-extractor-pack # --cpu=darwin_x86_64 # Uncomment on Arm-based Macs
19+
bazel run //swift:create-extractor-pack
20+
```
21+
22+
If you are running on macOS and you encounter errors mentioning `XXX is unavailable: introduced in macOS YY.ZZ`,
23+
you will need to run this from the root of your `codeql` checkout:
24+
25+
```bash
26+
echo common --macos_sdk_version=$(sw_vers --productVersion) >> local.bazelrc
2027
```
2128

2229
which will install `swift/extractor-pack`.

0 commit comments

Comments
 (0)