mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
[compiler-rt] Remove llvm_gtest dependency from unit tests
All these unit tests already include ${COMPILER_RT_GTEST_SOURCE} as an
input source file and the target llvm_gtest does not exist for
standalone builds. Currently the DEPS argument is ignored for standalone
builds so the missing target is not a problem, but as part of fixing a
build race for standalone builds I am planning to include those
dependencies in COMPILER_RT_TEST_STANDALONE_BUILD_LIBS configurations.
Reviewed By: vitalybuka
Pull Request: https://github.com/llvm/llvm-project/pull/83649
This commit is contained in:
committed by
GitHub
parent
f50d3582b4
commit
55b90b5140
@@ -172,7 +172,7 @@ function(add_asan_tests arch test_runtime)
|
||||
function(generate_asan_tests test_objects test_suite testname)
|
||||
generate_compiler_rt_tests(${test_objects} ${test_suite} ${testname} ${arch}
|
||||
COMPILE_DEPS ${ASAN_UNITTEST_HEADERS} ${ASAN_IGNORELIST_FILE}
|
||||
DEPS llvm_gtest asan
|
||||
DEPS asan
|
||||
KIND ${TEST_KIND}
|
||||
${ARGN}
|
||||
)
|
||||
|
||||
@@ -74,7 +74,7 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST FUZZER_SUPPORTED_ARCH)
|
||||
FuzzerUnitTests "Fuzzer-${arch}-Test" ${arch}
|
||||
SOURCES FuzzerUnittest.cpp ${COMPILER_RT_GTEST_SOURCE}
|
||||
RUNTIME ${LIBFUZZER_TEST_RUNTIME}
|
||||
DEPS llvm_gtest ${LIBFUZZER_TEST_RUNTIME_DEPS}
|
||||
DEPS ${LIBFUZZER_TEST_RUNTIME_DEPS}
|
||||
CFLAGS ${LIBFUZZER_UNITTEST_CFLAGS} ${LIBFUZZER_TEST_RUNTIME_CFLAGS}
|
||||
LINK_FLAGS ${LIBFUZZER_UNITTEST_LINK_FLAGS} ${LIBFUZZER_TEST_RUNTIME_LINK_FLAGS})
|
||||
set_target_properties(FuzzerUnitTests PROPERTIES
|
||||
@@ -84,7 +84,7 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST FUZZER_SUPPORTED_ARCH)
|
||||
generate_compiler_rt_tests(FuzzedDataProviderTestObjects
|
||||
FuzzedDataProviderUnitTests "FuzzerUtils-${arch}-Test" ${arch}
|
||||
SOURCES FuzzedDataProviderUnittest.cpp ${COMPILER_RT_GTEST_SOURCE}
|
||||
DEPS llvm_gtest ${LIBFUZZER_TEST_RUNTIME_DEPS} ${COMPILER_RT_SOURCE_DIR}/include/fuzzer/FuzzedDataProvider.h
|
||||
DEPS ${LIBFUZZER_TEST_RUNTIME_DEPS} ${COMPILER_RT_SOURCE_DIR}/include/fuzzer/FuzzedDataProvider.h
|
||||
CFLAGS ${LIBFUZZER_UNITTEST_CFLAGS} ${LIBFUZZER_TEST_RUNTIME_CFLAGS}
|
||||
LINK_FLAGS ${LIBFUZZER_UNITTEST_LINK_FLAGS} ${LIBFUZZER_TEST_RUNTIME_LINK_FLAGS})
|
||||
set_target_properties(FuzzedDataProviderUnitTests PROPERTIES
|
||||
|
||||
@@ -74,7 +74,7 @@ if(COMPILER_RT_DEFAULT_TARGET_ARCH IN_LIST GWP_ASAN_SUPPORTED_ARCH)
|
||||
GwpAsanUnitTests "GwpAsan-${arch}-Test" ${arch}
|
||||
SOURCES ${GWP_ASAN_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE}
|
||||
RUNTIME ${GWP_ASAN_TEST_RUNTIME}
|
||||
DEPS llvm_gtest ${GWP_ASAN_UNIT_TEST_HEADERS}
|
||||
DEPS ${GWP_ASAN_UNIT_TEST_HEADERS}
|
||||
CFLAGS ${GWP_ASAN_UNITTEST_CFLAGS}
|
||||
LINK_FLAGS ${GWP_ASAN_UNITTEST_LINK_FLAGS})
|
||||
set_target_properties(GwpAsanUnitTests PROPERTIES
|
||||
|
||||
@@ -107,7 +107,6 @@ macro(add_interception_tests_for_arch arch)
|
||||
RUNTIME ${INTERCEPTION_COMMON_LIB}
|
||||
SOURCES ${INTERCEPTION_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE}
|
||||
COMPILE_DEPS ${INTERCEPTION_TEST_HEADERS}
|
||||
DEPS llvm_gtest
|
||||
CFLAGS ${INTERCEPTION_TEST_CFLAGS_COMMON}
|
||||
LINK_FLAGS ${INTERCEPTION_TEST_LINK_FLAGS_COMMON})
|
||||
endmacro()
|
||||
|
||||
@@ -70,7 +70,7 @@ macro(msan_compile obj_list source arch kind cflags)
|
||||
${obj_list} ${source} ${arch}
|
||||
KIND ${kind}
|
||||
COMPILE_DEPS ${MSAN_UNITTEST_HEADERS}
|
||||
DEPS llvm_gtest msan
|
||||
DEPS msan
|
||||
CFLAGS -isystem ${CMAKE_CURRENT_BINARY_DIR}/../libcxx_msan_${arch}/include/c++/v1
|
||||
${MSAN_UNITTEST_INSTRUMENTED_CFLAGS} ${cflags}
|
||||
)
|
||||
|
||||
@@ -73,7 +73,7 @@ macro(add_orc_unittest testname)
|
||||
SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
|
||||
RUNTIME "${ORC_RUNTIME_LIBS}"
|
||||
COMPILE_DEPS ${TEST_HEADERS} ${ORC_HEADERS}
|
||||
DEPS llvm_gtest ${ORC_DEPS}
|
||||
DEPS ${ORC_DEPS}
|
||||
CFLAGS ${ORC_UNITTEST_CFLAGS} ${COMPILER_RT_GTEST_CFLAGS}
|
||||
LINK_FLAGS ${ORC_UNITTEST_LINK_FLAGS})
|
||||
endif()
|
||||
|
||||
@@ -176,7 +176,6 @@ macro(add_sanitizer_tests_for_arch arch)
|
||||
RUNTIME "${SANITIZER_COMMON_LIB}"
|
||||
SOURCES ${SANITIZER_UNITTESTS} ${COMPILER_RT_GTEST_SOURCE} ${COMPILER_RT_GMOCK_SOURCE}
|
||||
COMPILE_DEPS ${SANITIZER_TEST_HEADERS}
|
||||
DEPS llvm_gtest
|
||||
CFLAGS ${SANITIZER_TEST_CFLAGS_COMMON} ${extra_flags}
|
||||
LINK_FLAGS ${SANITIZER_TEST_LINK_FLAGS_COMMON} ${TARGET_LINK_FLAGS} ${extra_flags})
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ macro(add_scudo_unittest testname)
|
||||
"${testname}-${arch}-Test" ${arch}
|
||||
SOURCES ${TEST_SOURCES} ${COMPILER_RT_GTEST_SOURCE}
|
||||
COMPILE_DEPS ${SCUDO_TEST_HEADERS}
|
||||
DEPS llvm_gtest scudo_standalone
|
||||
DEPS scudo_standalone
|
||||
RUNTIME ${RUNTIME}
|
||||
CFLAGS ${SCUDO_UNITTEST_CFLAGS}
|
||||
LINK_FLAGS ${SCUDO_UNITTEST_LINK_FLAGS})
|
||||
|
||||
@@ -64,7 +64,7 @@ foreach (header ${TSAN_HEADERS})
|
||||
list(APPEND TSAN_RTL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../${header})
|
||||
endforeach()
|
||||
|
||||
set(TSAN_DEPS llvm_gtest tsan)
|
||||
set(TSAN_DEPS tsan)
|
||||
# TSan uses C++ standard library headers.
|
||||
if (TARGET cxx-headers OR HAVE_LIBCXX)
|
||||
set(TSAN_DEPS cxx-headers)
|
||||
|
||||
@@ -109,7 +109,7 @@ macro(add_xray_unittest testname)
|
||||
${XRAY_HEADERS} ${XRAY_ALL_SOURCE_FILES_ABS_PATHS}
|
||||
"test_helpers.h"
|
||||
RUNTIME "${XRAY_RUNTIME_LIBS}"
|
||||
DEPS llvm_gtest xray llvm-xray LLVMXRay LLVMTestingSupport
|
||||
DEPS xray llvm-xray LLVMXRay LLVMTestingSupport
|
||||
CFLAGS ${XRAY_UNITTEST_CFLAGS}
|
||||
LINK_FLAGS ${TARGET_LINK_FLAGS} ${XRAY_UNITTEST_LINK_FLAGS}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user