summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2016-09-07 20:32:48 +0000
committerFrancis Ricci <francisjricci@gmail.com>2016-09-07 20:32:48 +0000
commit4a0c5cdd3e3feb1a94b78f1196668e83fedfbca8 (patch)
tree93c7079d0fa6d47fa02f910686248e44295e250b /cmake/Modules
parent58a7731dafc791d58adf86783dbd6cb420e651e5 (diff)
downloadcompiler-rt-4a0c5cdd3e3feb1a94b78f1196668e83fedfbca8.tar.gz
[compiler-rt] Fix library suffixes on windows
Summary: Make sure that windows libraries contain the suffixes expected by clang. This is expecially important when compiling the windows builtins with clang, as cmake will use .a as the suffix by default. Reviewers: beanz, compnerd Subscribers: llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D24046 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index 6ed4f1616..1a2e48992 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -195,8 +195,14 @@ function(add_compiler_rt_runtime name type)
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(WIN32 AND NOT CYGWIN AND NOT MINGW)
+ set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
+ set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")
+ endif()
endif()
install(TARGETS ${libname}
ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}