diff --git a/clang/cmake/caches/Fuchsia-stage2.cmake b/clang/cmake/caches/Fuchsia-stage2.cmake --- a/clang/cmake/caches/Fuchsia-stage2.cmake +++ b/clang/cmake/caches/Fuchsia-stage2.cmake @@ -14,7 +14,9 @@ endif() set(LLVM_ENABLE_LTO ON CACHE BOOL "") set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "") -set(LLVM_ENABLE_PIC OFF CACHE BOOL "") +if(NOT APPLE) + set(LLVM_ENABLE_PIC OFF CACHE BOOL "") +endif() set(LLVM_ENABLE_LIBCXX ON CACHE BOOL "") set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "") set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "") @@ -292,10 +294,13 @@ sancov CACHE STRING "") +if(APPLE) + set(target_components LTO) +endif() + set(LLVM_DISTRIBUTION_COMPONENTS clang lld - LTO clang-apply-replacements clang-doc clang-format @@ -307,5 +312,6 @@ clangd builtins runtimes + ${target_components} ${LLVM_TOOLCHAIN_TOOLS} CACHE STRING "") diff --git a/clang/cmake/caches/Fuchsia.cmake b/clang/cmake/caches/Fuchsia.cmake --- a/clang/cmake/caches/Fuchsia.cmake +++ b/clang/cmake/caches/Fuchsia.cmake @@ -9,7 +9,9 @@ set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "") set(LLVM_ENABLE_DIA_SDK OFF CACHE BOOL "") set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "") -set(LLVM_ENABLE_PIC OFF CACHE BOOL "") +if(NOT APPLE) + set(LLVM_ENABLE_PIC OFF CACHE BOOL "") +endif() set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "") set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "") set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")