[CMake] Add PARENT_TARGET option to add_sanitizer_rt_symbols.

Summary: This is another step in a multi-step refactoring to move add_sanitizer_rt_symbols in the direction of other add_* functions in compiler-rt.

Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D12409

llvm-svn: 246178
This commit is contained in:
Chris Bieneman 2015-08-27 18:27:33 +00:00
parent db3d58b94a
commit 2be86df4b1
2 changed files with 7 additions and 4 deletions

View File

@ -9,11 +9,12 @@ set(SANITIZER_LINT_SCRIPT
# interceptors are exported automatically, user can also provide files with
# symbol names that should be exported as well.
# add_sanitizer_rt_symbols(<name>
# PARENT_TARGET <convenience parent target>
# EXTRA <files with extra symbols to export>)
macro(add_sanitizer_rt_symbols name)
cmake_parse_arguments(ARG
""
""
"PARENT_TARGET"
"EXTRA"
${ARGN})
set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${name}.syms-stamp)
@ -50,6 +51,9 @@ macro(add_sanitizer_rt_symbols name)
install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
endif()
endif()
if(ARG_PARENT_TARGET)
add_dependencies(${ARG_PARENT_TARGET} ${name}-symbols)
endif()
endmacro()
macro(add_sanitizer_rt_version_list name)

View File

@ -97,12 +97,11 @@ else()
foreach(arch ${UBSAN_SUPPORTED_ARCH})
if (UNIX AND NOT ${arch} MATCHES "i386|i686")
add_sanitizer_rt_symbols(clang_rt.ubsan_standalone-${arch}
PARENT_TARGET ubsan
EXTRA ubsan.syms.extra)
add_sanitizer_rt_symbols(clang_rt.ubsan_standalone_cxx-${arch}
PARENT_TARGET ubsan
EXTRA ubsan.syms.extra)
add_dependencies(ubsan
clang_rt.ubsan_standalone-${arch}-symbols
clang_rt.ubsan_standalone_cxx-${arch}-symbols)
endif()
endforeach()
endif()