[llvm] 9efbb67 - [CMake] Add /winsysroot to lld-link when LLVM_WINSYSROOT is specified
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 5 09:58:58 PDT 2023
Author: Arthur Eubanks
Date: 2023-07-05T09:58:48-07:00
New Revision: 9efbb67939bd00b5ed60adc37baa01501c637c36
URL: https://github.com/llvm/llvm-project/commit/9efbb67939bd00b5ed60adc37baa01501c637c36
DIFF: https://github.com/llvm/llvm-project/commit/9efbb67939bd00b5ed60adc37baa01501c637c36.diff
LOG: [CMake] Add /winsysroot to lld-link when LLVM_WINSYSROOT is specified
So that the linker can find libraries in the winsysroot.
Reviewed By: hans, rnk
Differential Revision: https://reviews.llvm.org/D151946
Added:
Modified:
llvm/cmake/modules/HandleLLVMOptions.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index df487423bf2c12..365c8b962d42eb 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -494,6 +494,11 @@ if( MSVC )
message(ERROR "LLVM_WINSYSROOT requires clang-cl")
endif()
append("/winsysroot${LLVM_WINSYSROOT}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+ if (LINKER_IS_LLD_LINK)
+ append("/winsysroot:${LLVM_WINSYSROOT}"
+ CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS
+ CMAKE_SHARED_LINKER_FLAGS)
+ endif()
endif()
if (LLVM_ENABLE_WERROR)
More information about the llvm-commits
mailing list