diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2015-12-30 11:49:41 +0000 |
| commit | 45b533945f0851ec234ca846e1af5ee1e4df0b6e (patch) | |
| tree | 0a5b74c0b9ca73aded34df95c91fcaf3815230d8 /cmake | |
| parent | 7e86edd64bfae4e324224452e4ea879b3371a4bd (diff) | |
Notes
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/caches/Apple-stage1.cmake | 32 | ||||
| -rw-r--r-- | cmake/caches/Apple-stage2.cmake | 30 | ||||
| -rw-r--r-- | cmake/caches/README.txt | 18 |
3 files changed, 80 insertions, 0 deletions
diff --git a/cmake/caches/Apple-stage1.cmake b/cmake/caches/Apple-stage1.cmake new file mode 100644 index 000000000000..a5c3fdbbdfd0 --- /dev/null +++ b/cmake/caches/Apple-stage1.cmake @@ -0,0 +1,32 @@ +# This file sets up a CMakeCache for Apple-style bootstrap builds. It can be +# used on any Darwin system to approximate Apple Clang builds. + +if($ENV{DT_TOOLCHAIN_DIR}) + set(CMAKE_INSTALL_PREFIX $ENV{DT_TOOLCHAIN_DIR}/usr/) +else() + set(CMAKE_INSTALL_PREFIX /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.toolchain/usr/) +endif() + +set(LLVM_TARGETS_TO_BUILD X86 CACHE STRING "") +set(CLANG_VENDOR Apple CACHE STRING "") +set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "") +set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "") +set(LLVM_INCLUDE_UTILS OFF CACHE BOOL "") +set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "") +set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "") +set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "") +set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "") + +set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") +set(PACKAGE_VERSION 7.1.0 CACHE STRING "") + +# LIBCXX Settings +set(LIBCXX_INSTALL_LIBRARY OFF CACHE BOOL "") +set(LIBCXX_INSTALL_HEADERS ON CACHE BOOL "") +set(LIBCXX_OVERRIDE_DARWIN_INSTALL ON CACHE BOOL "") + +#bootstrap +set(CLANG_ENABLE_BOOTSTRAP ON CACHE BOOL "") +set(CLANG_BOOTSTRAP_CMAKE_ARGS + -C ${CMAKE_CURRENT_LIST_DIR}/Apple-stage2.cmake + CACHE STRING "") diff --git a/cmake/caches/Apple-stage2.cmake b/cmake/caches/Apple-stage2.cmake new file mode 100644 index 000000000000..bb319aaeb86c --- /dev/null +++ b/cmake/caches/Apple-stage2.cmake @@ -0,0 +1,30 @@ +# This file sets up a CMakeCache for Apple-style stage2 bootstrap. It is +# specified by the stage1 build. + +set(LLVM_TARGETS_TO_BUILD X86 ARM AArch64 CACHE STRING "") +set(CLANG_VENDOR Apple CACHE STRING "") +set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "") +set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "") +set(LLVM_INCLUDE_UTILS OFF CACHE BOOL "") +set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "") +set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "") +set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "") +set(COMPILER_RT_BUILD_SANITIZERS OFF CACHE BOOL "") +set(CLANG_LINKS_TO_CREATE clang++ cc c++ CACHE STRING "") + +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -flto -gline-tables-only -DNDEBUG" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os -flto -gline-tables-only -DNDEBUG" CACHE STRING "") +set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "") +set(PACKAGE_VERSION 7.1.0 CACHE STRING "") + +set(LIBCXX_INSTALL_LIBRARY OFF CACHE BOOL "") +set(LIBCXX_INSTALL_HEADERS OFF CACHE BOOL "") + +# setup toolchain +set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "") +set(LLVM_TOOLCHAIN_TOOLS + llvm-dsymutil + llvm-cov + llvm-dwarfdump + llvm-profdata + CACHE STRING "") diff --git a/cmake/caches/README.txt b/cmake/caches/README.txt new file mode 100644 index 000000000000..55e5e159db13 --- /dev/null +++ b/cmake/caches/README.txt @@ -0,0 +1,18 @@ +CMake Caches +============ + +This directory contains CMake cache scripts that pre-populate the CMakeCache in +a build directory with commonly used settings. + +The first two cache files in the directory are used by Apple to build the clang +distribution packaged with Xcode. You can use the caches with the following +CMake invocation: + +cmake -G <build system> + -C <path to llvm>/tools/clang/cmake/caches/Apple-stage1.cmake + -DCMAKE_BUILD_TYPE=Release + [-DCMAKE_INSTALL_PREFIX=<install path>] + <path to llvm> + +Building the `bootstrap` target from this generation will build clang, and +`bootstrap-install` will install it. |
