Index: llvm/cmake/modules/LLVMExternalProjectUtils.cmake =================================================================== --- llvm/cmake/modules/LLVMExternalProjectUtils.cmake +++ llvm/cmake/modules/LLVMExternalProjectUtils.cmake @@ -56,6 +56,8 @@ set(ARG_TOOLCHAIN_TOOLS clang lld llvm-ar llvm-ranlib llvm-nm llvm-objdump) if(_cmake_system_name STREQUAL Darwin) list(APPEND ARG_TOOLCHAIN_TOOLS llvm-libtool-darwin llvm-lipo) + elseif(_cmake_system_name STREQUAL Windows) + list(APPEND ARG_TOOLCHAIN_TOOLS llvm-lib) else() # TODO: These tools don't fully support Mach-O format yet. list(APPEND ARG_TOOLCHAIN_TOOLS llvm-objcopy llvm-strip) @@ -144,7 +146,11 @@ endif() endif() if(llvm-ar IN_LIST TOOLCHAIN_TOOLS) - list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}) + if(_cmake_system_name STREQUAL Windows) + list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-lib${CMAKE_EXECUTABLE_SUFFIX}) + else() + list(APPEND compiler_args -DCMAKE_AR=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-ar${CMAKE_EXECUTABLE_SUFFIX}) + endif() endif() if(llvm-libtool-darwin IN_LIST TOOLCHAIN_TOOLS) list(APPEND compiler_args -DCMAKE_LIBTOOL=${LLVM_RUNTIME_OUTPUT_INTDIR}/llvm-libtool-darwin${CMAKE_EXECUTABLE_SUFFIX})