2017-02-18 03:28:54 +08:00
|
|
|
# This file sets up a CMakeCache for a Fuchsia toolchain build.
|
|
|
|
|
2019-11-20 11:56:54 +08:00
|
|
|
set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64;RISCV CACHE STRING "")
|
2017-02-18 03:28:54 +08:00
|
|
|
|
|
|
|
set(PACKAGE_VENDOR Fuchsia CACHE STRING "")
|
|
|
|
|
|
|
|
set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
|
2018-06-28 13:15:46 +08:00
|
|
|
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
|
2017-11-28 04:29:13 +08:00
|
|
|
set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
|
2019-10-25 07:24:00 +08:00
|
|
|
set(LLVM_ENABLE_UNWIND_TABLES OFF CACHE BOOL "")
|
2017-11-28 04:29:13 +08:00
|
|
|
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
|
2019-01-15 09:15:00 +08:00
|
|
|
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
|
2019-10-25 07:24:00 +08:00
|
|
|
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
|
|
|
|
set(LLVM_INCLUDE_GO_TESTS OFF CACHE BOOL "")
|
2019-01-15 09:15:00 +08:00
|
|
|
|
|
|
|
set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
|
|
|
|
if(NOT APPLE)
|
|
|
|
set(CLANG_DEFAULT_LINKER lld CACHE STRING "")
|
|
|
|
set(CLANG_DEFAULT_OBJCOPY llvm-objcopy CACHE STRING "")
|
|
|
|
endif()
|
|
|
|
set(CLANG_DEFAULT_RTLIB compiler-rt CACHE STRING "")
|
2019-10-25 07:24:00 +08:00
|
|
|
set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
|
|
|
|
set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
|
2017-02-18 03:28:54 +08:00
|
|
|
set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
|
|
|
|
|
2019-08-30 07:12:06 +08:00
|
|
|
set(ENABLE_EXPERIMENTAL_NEW_PASS_MANAGER ON CACHE BOOL "")
|
2019-01-06 12:14:51 +08:00
|
|
|
set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")
|
|
|
|
set(ENABLE_X86_RELAX_RELOCATIONS ON CACHE BOOL "")
|
|
|
|
|
2017-12-22 06:10:27 +08:00
|
|
|
set(LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
|
2017-02-18 03:28:54 +08:00
|
|
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
|
2019-10-25 07:24:00 +08:00
|
|
|
if (APPLE)
|
|
|
|
set(MACOSX_DEPLOYMENT_TARGET 10.7 CACHE STRING "")
|
|
|
|
endif()
|
2017-02-18 03:28:54 +08:00
|
|
|
|
2017-04-14 05:09:42 +08:00
|
|
|
if(APPLE)
|
|
|
|
set(COMPILER_RT_ENABLE_IOS OFF CACHE BOOL "")
|
|
|
|
set(COMPILER_RT_ENABLE_TVOS OFF CACHE BOOL "")
|
|
|
|
set(COMPILER_RT_ENABLE_WATCHOS OFF CACHE BOOL "")
|
|
|
|
endif()
|
|
|
|
|
2019-06-05 14:58:41 +08:00
|
|
|
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
|
|
|
|
set(LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
|
|
|
|
set(LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
|
|
|
|
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
|
|
|
|
set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
|
|
|
|
set(LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
|
|
|
|
set(LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
|
|
|
|
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
|
|
|
|
set(LIBCXX_ABI_VERSION 2 CACHE STRING "")
|
|
|
|
set(LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
|
|
|
|
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
|
|
|
|
set(LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
|
|
|
|
|
2018-11-16 12:50:12 +08:00
|
|
|
if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
|
|
|
|
set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}")
|
|
|
|
if(STAGE2_LINUX_${target}_SYSROOT)
|
|
|
|
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
|
|
|
|
set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
|
|
|
|
set(BUILTINS_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
|
|
|
|
set(LLVM_BUILTIN_TARGETS "${target}" CACHE STRING "")
|
|
|
|
|
|
|
|
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
|
|
|
|
set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
|
|
|
|
set(RUNTIMES_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
|
|
|
|
set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
|
|
|
|
set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
|
|
|
|
set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
|
|
|
|
set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
|
|
|
|
set(LLVM_RUNTIME_TARGETS "${target}" CACHE STRING "")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-02-13 00:24:46 +08:00
|
|
|
if(UNIX)
|
|
|
|
set(BOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
|
|
|
|
set(BOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
|
|
|
|
set(BOOTSTRAP_CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
|
|
|
|
endif()
|
|
|
|
|
2019-01-15 09:15:00 +08:00
|
|
|
set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
|
|
|
|
if(NOT APPLE)
|
|
|
|
set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")
|
|
|
|
endif()
|
|
|
|
|
2017-02-18 03:28:54 +08:00
|
|
|
set(CLANG_BOOTSTRAP_TARGETS
|
|
|
|
check-all
|
|
|
|
check-llvm
|
|
|
|
check-clang
|
2019-01-02 13:11:57 +08:00
|
|
|
check-lld
|
2017-02-18 03:28:54 +08:00
|
|
|
llvm-config
|
|
|
|
test-suite
|
|
|
|
test-depends
|
|
|
|
llvm-test-depends
|
|
|
|
clang-test-depends
|
2019-01-02 13:11:57 +08:00
|
|
|
lld-test-depends
|
2017-02-18 03:28:54 +08:00
|
|
|
distribution
|
|
|
|
install-distribution
|
2018-06-06 13:18:39 +08:00
|
|
|
install-distribution-stripped
|
2019-01-02 13:11:57 +08:00
|
|
|
install-distribution-toolchain
|
2017-02-18 03:28:54 +08:00
|
|
|
clang CACHE STRING "")
|
|
|
|
|
2018-05-08 10:47:13 +08:00
|
|
|
get_cmake_property(variableNames VARIABLES)
|
|
|
|
foreach(variableName ${variableNames})
|
|
|
|
if(variableName MATCHES "^STAGE2_")
|
|
|
|
string(REPLACE "STAGE2_" "" new_name ${variableName})
|
|
|
|
list(APPEND EXTRA_ARGS "-D${new_name}=${${variableName}}")
|
2017-07-19 10:57:47 +08:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2017-02-18 03:28:54 +08:00
|
|
|
|
|
|
|
# Setup the bootstrap build.
|
|
|
|
set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "")
|
2018-06-12 06:06:44 +08:00
|
|
|
set(CLANG_BOOTSTRAP_EXTRA_DEPS
|
|
|
|
builtins
|
|
|
|
runtimes
|
|
|
|
CACHE STRING "")
|
2017-02-18 03:28:54 +08:00
|
|
|
set(CLANG_BOOTSTRAP_CMAKE_ARGS
|
|
|
|
${EXTRA_ARGS}
|
|
|
|
-C ${CMAKE_CURRENT_LIST_DIR}/Fuchsia-stage2.cmake
|
|
|
|
CACHE STRING "")
|