1# This file sets up a CMakeCache for a Fuchsia toolchain build. 2 3set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "") 4 5set(PACKAGE_VENDOR Fuchsia CACHE STRING "") 6 7set(LLVM_ENABLE_PROJECTS "clang;clang-tools-extra;lld;llvm" CACHE STRING "") 8 9set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "") 10set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "") 11set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "") 12set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "") 13set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "") 14set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "") 15set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "") 16set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "") 17 18if(MSVC) 19 set(LLVM_USE_CRT_RELEASE "MT" CACHE STRING "") 20endif() 21 22set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "") 23if(NOT APPLE) 24 set(CLANG_DEFAULT_LINKER lld CACHE STRING "") 25 set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "") 26endif() 27set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "") 28set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "") 29set(CLANG_ENABLE_STATIC_ANALYZER ON CACHE BOOL "") 30set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "") 31 32set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER ON CACHE BOOL "") 33set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "") 34set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "") 35 36set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") 37set(CMAKE_BUILD_TYPE Release CACHE STRING "") 38if(APPLE) 39 set(MACOSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "") 40elseif(MSVC) 41 set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded" CACHE STRING "") 42endif() 43 44if(APPLE) 45 set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "") 46 set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "") 47 set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "") 48endif() 49 50set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") 51set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "") 52set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") 53set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") 54set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "") 55set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "") 56set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") 57set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") 58set(LIBCXX_ABI_VERSION 2 CACHE STRING "") 59set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") 60if(WIN32) 61 set(LIBCXX_HAS_WIN32_THREAD_API ON CACHE BOOL "") 62 set(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY OFF CACHE BOOL "") 63 set(LIBCXX_ENABLE_FILESYSTEM OFF CACHE BOOL "") 64 set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "") 65 set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY OFF CACHE BOOL "") 66 set(BUILTINS_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "") 67 set(RUNTIMES_CMAKE_ARGS -DCMAKE_SYSTEM_NAME=Windows CACHE STRING "") 68 set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx" CACHE STRING "") 69else() 70 set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "") 71 set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "") 72endif() 73 74if(BOOTSTRAP_CMAKE_SYSTEM_NAME) 75 set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}") 76 if(STAGE2_LINUX_${target}_SYSROOT) 77 set(LLVM_BUILTIN_TARGETS "${target}" CACHE STRING "") 78 set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "") 79 set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "") 80 set(BUILTINS_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "") 81 82 set(LLVM_RUNTIME_TARGETS "${target}" CACHE STRING "") 83 set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "") 84 set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "") 85 set(RUNTIMES_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "") 86 set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "") 87 set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "") 88 set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") 89 set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "") 90 set(RUNTIMES_${target}_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "") 91 set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "") 92 set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") 93 set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") 94 set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "") 95 set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "") 96 set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "") 97 set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "") 98 set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "") 99 set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "") 100 set(RUNTIMES_${target}_LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind" CACHE STRING "") 101 set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "") 102 set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "") 103 endif() 104endif() 105 106if(UNIX) 107 set(BOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "") 108 set(BOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "") 109 set(BOOTSTRAP_CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "") 110endif() 111 112set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "") 113if(NOT APPLE) 114 set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "") 115endif() 116 117set(CLANG_BOOTSTRAP_TARGETS 118 check-all 119 check-llvm 120 check-clang 121 check-lld 122 llvm-config 123 test-suite 124 test-depends 125 llvm-test-depends 126 clang-test-depends 127 lld-test-depends 128 distribution 129 install-distribution 130 install-distribution-stripped 131 install-distribution-toolchain 132 clang CACHE STRING "") 133 134get_cmake_property(variableNames VARIABLES) 135foreach(variableName ${variableNames}) 136 if(variableName MATCHES "^STAGE2_") 137 string(REPLACE "STAGE2_" "" new_name ${variableName}) 138 list(APPEND EXTRA_ARGS "-D${new_name}=${${variableName}}") 139 endif() 140endforeach() 141 142# Setup the bootstrap build. 143set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") 144set(CLANG_BOOTSTRAP_EXTRA_DEPS 145 builtins 146 runtimes 147 CACHE STRING "") 148set(CLANG_BOOTSTRAP_CMAKE_ARGS 149 ${EXTRA_ARGS} 150 -C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake 151 CACHE STRING "") 152