Skip to content

Commit

Permalink
Make sure to build x86_64 binaries on Mac.
Browse files Browse the repository at this point in the history
On the new ARM64 Macs, the default target architecture is ARM64. However ARM64 binaries only run on those new Macs, whereas the x86_64 run on both newer and older Macs.

The longer term fix might be to have both an x86_64 and a darwin_arm64 binary.
  • Loading branch information
mprobst committed Apr 29, 2022
1 parent fa4532a commit f0df2e6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ mkdir -p ~/src/llvm-project/build.release
pushd ~/src/llvm-project/build.release

echo === Building based on r$(git log -n 1 --pretty=format:"%h") ...
cmake -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DLLVM_ENABLE_PROJECTS=clang ../llvm
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DLLVM_ENABLE_PROJECTS=clang \
-DLLVM_TARGET_ARCH=x86_64 \
-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
../llvm
ninja clang-format
popd

Expand Down

0 comments on commit f0df2e6

Please sign in to comment.