From 9914bacf2c090d411e47e6338fd132b2ea91e892 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski Date: Sun, 2 Oct 2022 16:44:27 +0100 Subject: [PATCH] [CI] Include `-DLLVM_BYILD_LLVM_DYLIB` on Darwin This extra CMake flag makse sure that libLLVM.dylib is built, which is required when using `clang` from HomeBrew (which is built with LTO enabled). --- .github/workflows/x86-darwin-llvm-from-sources.yml | 1 + tools/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/x86-darwin-llvm-from-sources.yml b/.github/workflows/x86-darwin-llvm-from-sources.yml index 79c1bc5..338074b 100644 --- a/.github/workflows/x86-darwin-llvm-from-sources.yml +++ b/.github/workflows/x86-darwin-llvm-from-sources.yml @@ -32,6 +32,7 @@ jobs: -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ -DLLVM_TARGETS_TO_BUILD="X86" \ -DLLVM_OPTIMIZED_TABLEGEN=ON \ + -DLLVM_BUILD_LLVM_DYLIB=ON \ -DDEFAULT_SYSROOT="$(xcrun --show-sdk-path)" \ ../llvm ninja diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 3361562..2de5b1c 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -34,6 +34,9 @@ set(ct-code-style-checker_SOURCES # triggered for static libs) # * `libclang-cpp`/`libLLVM` include all Clang/LLVM libraries (i.e. all the # libraries listed below _and more_) +# +# TODO: Once LLVM 16 is released, replace `try_compile` with a test for +# LLVM_ENABLE_LTO, see https://reviews.llvm.org/D134936. set(libs "clangTooling") try_compile(testMinimalCompilation "${CMAKE_BINARY_DIR}/temp" SOURCES