Skip to content

Commit 0a8bd77

Browse files
committed
[cmake] Enable thin lto cache when building with lld-link
This was enabled for other platforms. Added option for Windows/lld-link. Differential Revision: https://reviews.llvm.org/D69941
1 parent ff3b513 commit 0a8bd77

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/cmake/modules/HandleLLVMOptions.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,9 @@ if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
870870
elseif(LLVM_USE_LINKER STREQUAL "gold")
871871
append("-Wl,--plugin-opt,cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
872872
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
873+
elseif(LINKER_IS_LLD_LINK)
874+
append("/lldltocache:${PROJECT_BINARY_DIR}/lto.cache"
875+
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
873876
endif()
874877
elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
875878
append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)

0 commit comments

Comments
 (0)