Index: cmake/Modules/AddCompilerRT.cmake =================================================================== --- cmake/Modules/AddCompilerRT.cmake +++ cmake/Modules/AddCompilerRT.cmake @@ -195,8 +195,13 @@ set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${output_name_${libname}}) set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime") - if(LIB_LINK_LIBS AND ${type} STREQUAL "SHARED") - target_link_libraries(${libname} ${LIB_LINK_LIBS}) + if(${type} STREQUAL "SHARED") + if(LIB_LINK_LIBS) + target_link_libraries(${libname} ${LIB_LINK_LIBS}) + endif() + if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows") + set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") + endif() endif() install(TARGETS ${libname} ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} Index: cmake/base-config-ix.cmake =================================================================== --- cmake/base-config-ix.cmake +++ cmake/base-config-ix.cmake @@ -86,6 +86,11 @@ option(COMPILER_RT_ENABLE_TVOS "Enable building for tvOS - Experimental" Off) endif() +if("${CMAKE_SYSTEM_NAME}" MATCHES "Windows") + set(CMAKE_STATIC_LIBRARY_SUFFIX_C ".lib") + set(CMAKE_STATIC_LIBRARY_SUFFIX_CXX ".lib") +endif() + macro(test_targets) # Find and run MSVC (not clang-cl) and get its version. This will tell clang-cl # what version of MSVC to pretend to be so that the STL works.