From ad10495afae46e43e5dc7e416dac1cc1426ef0f2 Mon Sep 17 00:00:00 2001 From: Sebastian Ullrich Date: Thu, 18 Nov 2021 17:38:33 +0100 Subject: [PATCH] chore: macOS: build with system c++ --- .github/workflows/ci.yml | 3 +-- script/prepare-llvm-macos.sh | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39f2ada153..8d6a4c0e41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,8 +45,7 @@ jobs: os: macos-latest release: true shell: bash -euxo pipefail {0} - # Mojave, oldest maintained version as of 2021 - CMAKE_OPTIONS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 + CMAKE_OPTIONS: -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 llvm-url: https://github.com/leanprover/lean-llvm/releases/download/13.0.0/lean-llvm-x86_64-apple-darwin.tar.zst prepare-llvm: script/prepare-llvm-macos.sh lean-llvm* binary-check: otool -L diff --git a/script/prepare-llvm-macos.sh b/script/prepare-llvm-macos.sh index f539772b8d..0d313ee54d 100755 --- a/script/prepare-llvm-macos.sh +++ b/script/prepare-llvm-macos.sh @@ -29,11 +29,11 @@ cp $SDK/usr/lib/libSystem.tbd stage1/lib/libc # use for linking, use system libs for running gcp llvm/lib/lib{c++,c++abi,unwind}.dylib stage1/lib/libc echo -n " -DLEAN_STANDALONE=ON" -echo -n " -DCMAKE_C_COMPILER=$PWD/stage1/bin/clang -DCMAKE_CXX_COMPILER=$PWD/llvm/bin/clang++" -# allow C++ code to include /usr since it needs quite a few more headers -# need no-macro-redefined for weird clang stdint.h -echo -n " -DLEAN_EXTRA_CXX_FLAGS='--sysroot $PWD/llvm --stdlib=libc++ -I $SDK/usr/include -Wno-macro-redefined'" +# do not change C++ compiler; libc++ etc. being system libraries means there's no danger of conflicts, +# and the custom clang++ outputs a myriad of warnings when consuming the SDK +echo -n " -DCMAKE_C_COMPILER=$PWD/stage1/bin/clang" echo -n " -DGMP_LIBRARIES=lib/libgmp.a -DGMP_INCLUDE_DIR=/usr/local/opt/gmp/include" +# need no-macro-redefined for weird clang stdint.h echo -n " -DLEANC_INTERNAL_FLAGS='--sysroot ROOT -I ROOT/include/clang -Wno-macro-redefined' -DLEANC_CC=ROOT/bin/clang" echo -n " -DLEANC_INTERNAL_LINKER_FLAGS='-L ROOT/lib -L ROOT/lib/libc -fuse-ld=lld'" # do not set `LEAN_CC` for tests