summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-08-16 22:16:29 +0000
committerChris Bieneman <beanz@apple.com>2016-08-16 22:16:29 +0000
commiteb1960e75654998eb9ade318fbcabaae4fa0064d (patch)
treee294a58327f37945877967bff0dd2b65f73c21f8 /CMakeLists.txt
parent7200cc30735502829d6dcec5fbc25e8d1f6c5f00 (diff)
[CMake] Workflow improvements to PGO generation
This patch adds a few new convenience options used by the PGO CMake cache to setup options on bootstrap stages. The new options are: PGO_INSTRUMENT_LTO - Builds the instrumented and final builds with LTO PGO_BUILD_CONFIGURATION - Accepts a CMake cache script that can be used for complex configuration of the stage2-instrumented and stage2 builds. The patch also includes a fix for bootstrap dependencies so that the instrumented LTO tools don't get used when building the final stage, and it adds distribution targets to the passthrough. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt19
1 files changed, 15 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2359360207..e6dde85bc2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -571,11 +571,22 @@ if (CLANG_ENABLE_BOOTSTRAP)
if(LLVM_BUILD_INSTRUMENTED)
set(PGO_DEP generate-profdata)
set(PGO_OPT -DLLVM_PROFDATA_FILE=${CMAKE_CURRENT_BINARY_DIR}/utils/perf-training/clang.profdata)
- set(COMPILER_OPTIONS
- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
- -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
- -DCMAKE_ASM_COMPILER=${CMAKE_ASM_COMPILER})
+ # Use the current tools for LTO instead of the instrumented ones
+ list(APPEND _BOOTSTRAP_DEFAULT_PASSTHROUGH
+ CMAKE_CXX_COMPILER
+ CMAKE_C_COMPILER
+ CMAKE_ASM_COMPILER
+ CMAKE_AR
+ CMAKE_RANLIB
+ DARWIN_LTO_LIBRARY
+ DYLD_LIBRARY_PATH)
+
+ set(COMPILER_OPTIONS)
+ set(LTO_LIBRARY)
set(RUNTIME_DEP) # Don't set runtime dependencies
+ set(LTO_DEP) # Don't need to depend on LTO
+ set(LTO_AR)
+ set(LTO_RANLIB)
endif()
# Find all variables that start with BOOTSTRAP_ and populate a variable with