Skip to content

Clang: Look for llvm-lib when using MSVC-like front-end

Shoaib Meenai requested to merge smeenai/cmake:master into master

!4409 (merged) changed CMake to use lib instead of link /lib to create static libraries, but it didn't search for llvm-lib. If you have llvm-lib but not lib (e.g. when cross-compiling), when CMakeFindBinutils is invoked for the C and CXX languages, CMAKE_AR is not found. When it's subsequently invoked for the ASM language, CMAKE_ASM_SIMULATE_ID and CMAKE_ASM_COMPILER_FRONTEND_VARIANT are not set (because CMakeDetermineASMCompiler doesn't call CMAKE_DETERMINE_COMPILER_ID, which sets those variables), so we go down the non-MSVC conditional and set CMAKE_AR to a GNU-style ar, which of course does not understand lib flags. Explicitly search for llvm-lib to avoid this situation.

Backport: release
Topic-rename: clang-llvm-lib

Edited by Brad King

Merge request reports