[PATCH] D121215: [cmake] Add LLVM_THINLTO_CACHE_PATH
Tobias Hieta via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 13 23:47:55 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc572c6ae5627: [cmake] Add LLVM_THINLTO_CACHE_PATH (authored by thieta).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121215/new/
https://reviews.llvm.org/D121215
Files:
llvm/cmake/modules/HandleLLVMOptions.cmake
Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -1082,6 +1082,8 @@
message(FATAL_ERROR "LLVM_BUILD_INSTRUMENTED and LLVM_BUILD_INSTRUMENTED_COVERAGE cannot both be specified")
endif()
+set(LLVM_THINLTO_CACHE_PATH "${PROJECT_BINARY_DIR}/lto.cache" CACHE STRING "Set ThinLTO cache path. This can be used when building LLVM from several different directiories.")
+
if(LLVM_ENABLE_LTO AND LLVM_ON_WIN32 AND NOT LINKER_IS_LLD_LINK AND NOT MINGW)
message(FATAL_ERROR "When compiling for Windows, LLVM_ENABLE_LTO requires using lld as the linker (point CMAKE_LINKER at lld-link.exe)")
endif()
@@ -1095,16 +1097,16 @@
# improves incremental build time.
# FIXME: We should move all this logic into the clang driver.
if(APPLE)
- append("-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
+ append("-Wl,-cache_path_lto,${LLVM_THINLTO_CACHE_PATH}"
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
elseif((UNIX OR MINGW) AND LLVM_USE_LINKER STREQUAL "lld")
- append("-Wl,--thinlto-cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
+ append("-Wl,--thinlto-cache-dir=${LLVM_THINLTO_CACHE_PATH}"
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
elseif(LLVM_USE_LINKER STREQUAL "gold")
- append("-Wl,--plugin-opt,cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
+ append("-Wl,--plugin-opt,cache-dir=${LLVM_THINLTO_CACHE_PATH}"
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
elseif(LINKER_IS_LLD_LINK)
- append("/lldltocache:${PROJECT_BINARY_DIR}/lto.cache"
+ append("/lldltocache:${LLVM_THINLTO_CACHE_PATH}"
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
endif()
elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121215.415012.patch
Type: text/x-patch
Size: 1865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220314/64b29b14/attachment.bin>
More information about the llvm-commits
mailing list