diff options
author | Chris Bieneman <beanz@apple.com> | 2016-02-12 19:06:12 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2016-02-12 19:06:12 +0000 |
commit | 1e8d80e79ca344bf1ca4cf4c8b73bc8c32a02db5 (patch) | |
tree | 399fa24dfbe579d3f915a035191bb9b7f8da826b /clang/CMakeLists.txt | |
parent | 4acff966462d17aa2d22100e8ed8742baefca4b8 (diff) |
[CMake] Pass stage1 tools through to stage2 when building with LTO
This was originally a hacky if(APPLE) block. Now that we have an option for enabling LTO, it is better to properly gate this.
llvm-svn: 260707
Diffstat (limited to 'clang/CMakeLists.txt')
-rw-r--r-- | clang/CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 8a93f921274c..be8a7aa522d3 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -677,11 +677,15 @@ if (CLANG_ENABLE_BOOTSTRAP) # If on Darwin we need to make bootstrap depend on LTO and pass # DARWIN_LTO_LIBRARY so that -flto will work using the just-built compiler - if(APPLE) + if(BOOTSTRAP_LLVM_ENABLE_LTO OR LLVM_ENABLE_LTO) set(LTO_DEP LTO llvm-ar llvm-ranlib) - set(LTO_LIBRARY -DDARWIN_LTO_LIBRARY=${LLVM_SHLIB_OUTPUT_INTDIR}/libLTO.dylib) set(LTO_AR -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar) set(LTO_RANLIB -DCMAKE_RANLIB=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ranlib) + if(APPLE) + set(LTO_LIBRARY -DDARWIN_LTO_LIBRARY=${LLVM_SHLIB_OUTPUT_INTDIR}/libLTO.dylib) + elseif(NOT WIN32) + list(APPEND LTO_DEP LLVMgold) + endif() endif() add_custom_target(${NEXT_CLANG_STAGE}-clear |