diff options
author | Petr Hosek <phosek@chromium.org> | 2019-04-30 17:32:05 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-04-30 17:32:05 +0000 |
commit | 1d522aa47362ac5dd758fb67800de05343cc3ff0 (patch) | |
tree | 04d46547b270323f9b84484cb9038e0e8105fee9 /cmake/Modules | |
parent | 2ac8e2003401eef2119ec05c9d596756703d5681 (diff) | |
download | compiler-rt-1d522aa47362ac5dd758fb67800de05343cc3ff0.tar.gz |
Revert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"
This reverts commit r359576 since it's failing on Windows bots.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@359579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/Modules')
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 8b6518d13..bed0826ff 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -132,7 +132,7 @@ endmacro() # 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> -# {OBJECT|STATIC|SHARED} +# {STATIC|SHARED} # ARCHS <architectures> # OS <os list> # SOURCES <source files> @@ -144,8 +144,8 @@ endmacro() # PARENT_TARGET <convenience parent target> # ADDITIONAL_HEADERS <header files>) function(add_compiler_rt_runtime name type) - if(NOT type MATCHES "^(OBJECT|STATIC|SHARED)$") - message(FATAL_ERROR "type argument must be OBJECT, STATIC or SHARED") + if(NOT type MATCHES "^(STATIC|SHARED)$") + message(FATAL_ERROR "type argument must be STATIC or SHARED") return() endif() cmake_parse_arguments(LIB @@ -204,10 +204,7 @@ function(add_compiler_rt_runtime name type) message(FATAL_ERROR "Architecture ${arch} can't be targeted") return() endif() - if(type STREQUAL "OBJECT") - set(libname "${name}-${arch}") - set_output_name(output_name_${libname} ${name}${COMPILER_RT_OS_SUFFIX} ${arch}) - elseif(type STREQUAL "STATIC") + if(type STREQUAL "STATIC") set(libname "${name}-${arch}") set_output_name(output_name_${libname} ${name} ${arch}) else() @@ -273,34 +270,12 @@ function(add_compiler_rt_runtime name type) set(COMPONENT_OPTION COMPONENT ${libname}) endif() - if(type STREQUAL "OBJECT") - string(TOUPPER ${CMAKE_BUILD_TYPE} config) - get_property(cflags SOURCE ${sources_${libname}} PROPERTY COMPILE_FLAGS) - separate_arguments(cflags) - add_custom_command( - OUTPUT ${output_dir_${libname}}/${output_name_${libname}}.o - COMMAND ${CMAKE_C_COMPILER} ${sources_${libname}} ${cflags} ${extra_cflags_${libname}} -c -o ${output_dir_${libname}}/${output_name_${libname}}.o - DEPENDS ${sources_${libname}} - COMMENT "Building C object ${output_name_${libname}}.o") - add_custom_target(${libname} DEPENDS ${output_dir_${libname}}/${output_name_${libname}}.o) - install(FILES ${output_dir_${libname}}/${output_name_${libname}}.o - DESTINATION ${install_dir_${libname}} - ${COMPONENT_OPTION}) - else() - add_library(${libname} ${type} ${sources_${libname}}) - set_target_compile_flags(${libname} ${extra_cflags_${libname}}) - set_target_link_flags(${libname} ${extra_link_flags_${libname}}) - set_property(TARGET ${libname} APPEND PROPERTY - COMPILE_DEFINITIONS ${LIB_DEFS}) - set_target_output_directories(${libname} ${output_dir_${libname}}) - install(TARGETS ${libname} - ARCHIVE DESTINATION ${install_dir_${libname}} - ${COMPONENT_OPTION} - LIBRARY DESTINATION ${install_dir_${libname}} - ${COMPONENT_OPTION} - RUNTIME DESTINATION ${install_dir_${libname}} - ${COMPONENT_OPTION}) - endif() + add_library(${libname} ${type} ${sources_${libname}}) + set_target_compile_flags(${libname} ${extra_cflags_${libname}}) + set_target_link_flags(${libname} ${extra_link_flags_${libname}}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_output_directories(${libname} ${output_dir_${libname}}) set_target_properties(${libname} PROPERTIES OUTPUT_NAME ${output_name_${libname}}) set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime") @@ -324,6 +299,13 @@ function(add_compiler_rt_runtime name type) ) endif() endif() + install(TARGETS ${libname} + ARCHIVE DESTINATION ${install_dir_${libname}} + ${COMPONENT_OPTION} + LIBRARY DESTINATION ${install_dir_${libname}} + ${COMPONENT_OPTION} + RUNTIME DESTINATION ${install_dir_${libname}} + ${COMPONENT_OPTION}) # We only want to generate per-library install targets if you aren't using # an IDE because the extra targets get cluttered in IDEs. |