diff options
Diffstat (limited to 'cmake/Modules/AddCompilerRT.cmake')
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 334224854ba2..42ae7ad1ecd5 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -77,6 +77,15 @@ macro(format_object_libs output suffix) endforeach() endmacro() +function(add_compiler_rt_component name) + add_custom_target(${name}) + set_target_properties(${name} PROPERTIES FOLDER "Compiler-RT Misc") + if(COMMAND runtime_register_component) + runtime_register_component(${name}) + endif() + add_dependencies(compiler-rt ${name}) +endfunction() + # Adds static or shared runtime for a list of architectures and operating # systems and puts it in the proper directory in the build and install trees. # add_compiler_rt_runtime(<name> @@ -164,6 +173,7 @@ function(add_compiler_rt_runtime name type) -P "${CMAKE_BINARY_DIR}/cmake_install.cmake") set_target_properties(install-${LIB_PARENT_TARGET} PROPERTIES FOLDER "Compiler-RT Misc") + add_dependencies(install-compiler-rt install-${LIB_PARENT_TARGET}) endif() endif() @@ -185,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} @@ -253,12 +269,6 @@ if(MSVC) # gtest use a lot of stuff marked as deprecated on Windows. list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations) - - # Visual Studio 2012 only supports up to 8 template parameters in - # std::tr1::tuple by default, but gtest requires 10 - if(MSVC_VERSION EQUAL 1700) - list(APPEND COMPILER_RT_GTEST_CFLAGS -D_VARIADIC_MAX=10) - endif() endif() # Link objects into a single executable with COMPILER_RT_TEST_COMPILER, |