[PATCH] D109625: [compiler-rt] Ensure required deps for tests targets are actually built
Leonard Chan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 24 16:13:43 PDT 2021
leonardchan updated this revision to Diff 374984.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109625/new/
https://reviews.llvm.org/D109625
Files:
compiler-rt/cmake/Modules/AddCompilerRT.cmake
compiler-rt/test/CMakeLists.txt
Index: compiler-rt/test/CMakeLists.txt
===================================================================
--- compiler-rt/test/CMakeLists.txt
+++ compiler-rt/test/CMakeLists.txt
@@ -1,5 +1,6 @@
# Needed for lit support in standalone builds.
include(AddLLVM)
+include(LLVMExternalProjectUtils)
option(COMPILER_RT_TEST_STANDALONE_BUILD_LIBS
"When set to ON and testing in a standalone build, test the runtime \
@@ -36,6 +37,21 @@
if (WIN32)
list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS KillTheDoctor)
endif()
+ elseif(COMPILER_RT_STANDALONE_BUILD)
+ # These are tools needed for testing in a standalone/runtimes build, but we
+ # don't have a corresponding CMAKE_* flag for. These will need to be rebuilt.
+ set(LIT_ONLY_TOOLS FileCheck count not clang-resource-headers)
+ foreach(dep ${LIT_ONLY_TOOLS})
+ if (NOT TARGET ${dep})
+ llvm_ExternalProject_BuildCmd(build_${dep} ${dep} ${BINARY_DIR})
+ add_custom_target(${dep}
+ COMMAND ${build_${dep}}
+ WORKING_DIRECTORY ${BINARY_DIR}
+ VERBATIM USES_TERMINAL)
+ endif()
+ endforeach()
+
+ list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS ${LIT_ONLY_TOOLS})
endif()
# Tests use C++ standard library headers.
if (TARGET cxx-headers OR HAVE_LIBCXX)
Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake
===================================================================
--- compiler-rt/cmake/Modules/AddCompilerRT.cmake
+++ compiler-rt/cmake/Modules/AddCompilerRT.cmake
@@ -598,6 +598,7 @@
CMAKE_OBJCOPY
CMAKE_OBJDUMP
CMAKE_STRIP
+ CMAKE_READELF
CMAKE_SYSROOT
LIBCXX_HAS_MUSL_LIBC
PYTHON_EXECUTABLE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109625.374984.patch
Type: text/x-patch
Size: 1673 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210924/5a1b53f1/attachment-0001.bin>
More information about the cfe-commits
mailing list