Skip to content

[llvm][cmake] Properly place clang runtime directory on linker command line when WinMsvc.cmake is involved #110084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,12 @@ function(append value)
endforeach(variable)
endfunction()

function(prepend value)
foreach(variable ${ARGN})
set(${variable} "${value} ${${variable}}" PARENT_SCOPE)
endforeach(variable)
endfunction()

function(append_if condition value)
if (${condition})
foreach(variable ${ARGN})
Expand Down Expand Up @@ -1196,7 +1202,7 @@ if (CLANG_CL AND (LLVM_BUILD_INSTRUMENTED OR LLVM_USE_SANITIZER))
endif()
file(TO_CMAKE_PATH "${clang_compiler_rt_file}" clang_compiler_rt_file)
get_filename_component(clang_runtime_dir "${clang_compiler_rt_file}" DIRECTORY)
append("/libpath:\"${clang_runtime_dir}\""
prepend("/libpath:\"${clang_runtime_dir}\""
CMAKE_EXE_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
Expand Down
Loading