Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / lib / sanitizer_common / symbolizer / CMakeLists.txt
blobab37454acbe19f80e536d977429a7e01e139f4cd
1 foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH})
2   get_target_flags_for_arch(${arch} TARGET_CFLAGS)
4   set(RTSanitizerCommonSymbolizerInternalDir
5       "${CMAKE_CURRENT_BINARY_DIR}/RTSanitizerCommonSymbolizerInternal.${arch}")
6   add_custom_command(OUTPUT ${RTSanitizerCommonSymbolizerInternalDir}
7                      COMMAND ${CMAKE_COMMAND} -E make_directory ${RTSanitizerCommonSymbolizerInternalDir})
9   add_custom_command(OUTPUT RTSanitizerCommonSymbolizerInternal.${arch}.o
10                      DEPENDS ${RTSanitizerCommonSymbolizerInternalDir} 
11                              sanitizer_wrappers.cpp
12                              sanitizer_symbolize.cpp
13                              scripts/build_symbolizer.sh
14                      WORKING_DIRECTORY ${RTSanitizerCommonSymbolizerInternalDir}
15                      COMMAND FLAGS=${TARGET_CFLAGS}
16                              CLANG=${LLVM_RUNTIME_OUTPUT_INTDIR}/clang
17                              ${CMAKE_CURRENT_SOURCE_DIR}/scripts/build_symbolizer.sh
18                              ${CMAKE_CURRENT_BINARY_DIR}/RTSanitizerCommonSymbolizerInternal.${arch}.o
19                      USES_TERMINAL)
21   add_custom_target(RTSanitizerCommonSymbolizerInternalObj.${arch}
22                     DEPENDS RTSanitizerCommonSymbolizerInternal.${arch}.o)
24   set_property(TARGET RTSanitizerCommonSymbolizerInternal.${arch}
25                PROPERTY IMPORTED_OBJECTS ${CMAKE_CURRENT_BINARY_DIR}/RTSanitizerCommonSymbolizerInternal.${arch}.o)
26 endforeach()