# CFLAGS <compile flags>
# LINK_FLAGS <linker flags>
# DEFS <compile definitions>
+# DEPS <dependencies>
# LINK_LIBS <linked libraries> (only for shared library)
# OBJECT_LIBS <object libraries to use as sources>
# PARENT_TARGET <convenience parent target>
cmake_parse_arguments(LIB
""
"PARENT_TARGET"
- "OS;ARCHS;SOURCES;CFLAGS;LINK_FLAGS;DEFS;LINK_LIBS;OBJECT_LIBS;ADDITIONAL_HEADERS"
+ "OS;ARCHS;SOURCES;CFLAGS;LINK_FLAGS;DEFS;DEPS;LINK_LIBS;OBJECT_LIBS;ADDITIONAL_HEADERS"
${ARGN})
set(libnames)
# Until we support this some other way, build compiler-rt runtime without LTO
RUNTIME DESTINATION ${install_dir_${libname}}
${COMPONENT_OPTION})
endif()
+ if(LIB_DEPS)
+ add_dependencies(${libname} ${LIB_DEPS})
+ endif()
set_target_properties(${libname} PROPERTIES
OUTPUT_NAME ${output_name_${libname}})
set_target_properties(${libname} PROPERTIES FOLDER "Compiler-RT Runtime")
append_list_if(COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG -Wglobal-constructors
TSAN_RTL_CFLAGS)
+if (TARGET cxx-headers OR HAVE_LIBCXX)
+ set(TSAN_DEPS cxx-headers)
+endif()
+
set(TSAN_SOURCES
rtl/tsan_clock.cpp
rtl/tsan_debugging.cpp
RTSanitizerCommonSymbolizer
RTUbsan
CFLAGS ${TSAN_RTL_CFLAGS}
+ DEPS ${TSAN_DEPS}
LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
LINK_LIBS ${TSAN_LINK_LIBS} objc
PARENT_TARGET tsan)
ARCHS ${TSAN_SUPPORTED_ARCH}
SOURCES ${TSAN_SOURCES} ${TSAN_CXX_SOURCES} ${TSAN_ASM_SOURCES}
ADDITIONAL_HEADERS ${TSAN_HEADERS}
- CFLAGS ${TSAN_RTL_CFLAGS})
+ CFLAGS ${TSAN_RTL_CFLAGS}
+ DEPS ${TSAN_DEPS})
# Build and check Go runtime.
set(BUILDGO_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/go/buildgo.sh)
$<TARGET_OBJECTS:RTUbsan.${arch}>
ADDITIONAL_HEADERS ${TSAN_HEADERS}
CFLAGS ${TSAN_RTL_CFLAGS}
+ DEPS ${TSAN_DEPS}
PARENT_TARGET tsan)
add_compiler_rt_runtime(clang_rt.tsan_cxx
STATIC
$<TARGET_OBJECTS:RTUbsan_cxx.${arch}>
ADDITIONAL_HEADERS ${TSAN_HEADERS}
CFLAGS ${TSAN_RTL_CFLAGS}
+ DEPS ${TSAN_DEPS}
PARENT_TARGET tsan)
list(APPEND TSAN_RUNTIME_LIBRARIES clang_rt.tsan-${arch}
clang_rt.tsan_cxx-${arch})