Author: Louis Dionne Date: 2021-10-05T19:45:50-04:00 New Revision: 54a8a0d09a572a0581c0755541847e016274e15c
URL: https://github.com/llvm/llvm-project/commit/54a8a0d09a572a0581c0755541847e016274e15c DIFF: https://github.com/llvm/llvm-project/commit/54a8a0d09a572a0581c0755541847e016274e15c.diff LOG: [runtimes] Allow FOO_TEST_CONFIG to be a relative path That makes it possible to store that value in a CMake cache if needed. Differential Revision: https://reviews.llvm.org/D110843 Added: Modified: libcxx/CMakeLists.txt libcxx/utils/ci/apple-install-libcxx.sh libcxx/utils/ci/run-buildbot libcxxabi/CMakeLists.txt libunwind/CMakeLists.txt Removed: ################################################################################ diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 6ab44e5785108..e117a264ff0b7 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -132,8 +132,12 @@ option(LIBCXX_ENABLE_INCOMPLETE_FEATURES are new library features under development. These features don't guarantee ABI stability nor the quality of completed library features. Vendors shipping the library may want to disable this option." ON) -set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/legacy.cfg.in" CACHE STRING - "The Lit testing configuration to use when running the tests.") +set(LIBCXX_TEST_CONFIG "legacy.cfg.in" CACHE STRING + "The path to the Lit testing configuration to use when running the tests. + If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxx/test/configs'.") +if (NOT IS_ABSOLUTE "${LIBCXX_TEST_CONFIG}") + set(LIBCXX_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/configs/${LIBCXX_TEST_CONFIG}") +endif() set(LIBCXX_TEST_PARAMS "" CACHE STRING "A list of parameters to run the Lit test suite with.") diff --git a/libcxx/utils/ci/apple-install-libcxx.sh b/libcxx/utils/ci/apple-install-libcxx.sh index c1ce72400e24c..c9f813fb98786 100755 --- a/libcxx/utils/ci/apple-install-libcxx.sh +++ b/libcxx/utils/ci/apple-install-libcxx.sh @@ -122,7 +122,7 @@ for arch in ${architectures}; do -DCMAKE_OSX_ARCHITECTURES="${arch}" \ -DLIBCXXABI_LIBRARY_VERSION="${version}" \ -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ - -DLIBCXX_TEST_CONFIG="${llvm_root}/libcxx/test/configs/apple-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in" ) xcrun --sdk "${sdk}" cmake --build "${build_dir}/${arch}" --target install-cxx install-cxxabi -- -v diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index fad5af3f9929a..5ac0a39a53a7c 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -189,95 +189,95 @@ check-generated-output) generic-cxx03) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx03.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-cxx11) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx11.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-cxx14) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx14.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-cxx17) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx17.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-cxx20) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx20.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-cxx2b) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-cxx2b.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-assertions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-assertions.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-debug-iterators) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-debug-iterators.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi check-abi-list ;; generic-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-noexceptions.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-modules) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-static) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-static.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-static.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-static.cfg.in" check-cxx-cxxabi ;; generic-32bit) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-32bits.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-clang-11) export CC=clang-11 export CXX=clang++-11 clean - generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-clang-12) export CC=clang-12 export CXX=clang++-12 clean - generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-gcc) @@ -297,73 +297,73 @@ generic-gcc-cxx11) generic-asan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-asan.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-msan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-msan.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-tsan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-tsan.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-ubsan) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-ubsan.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-with_llvm_unwinder) clean generate-cmake -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-singlethreaded) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-singlethreaded.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-no-debug) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-debug.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-no-filesystem) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-filesystem.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-no-random_device) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-random_device.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-no-localization) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-localization.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; generic-no-unicode) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-no-unicode.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; x86_64-apple-system) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/apple-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in" check-cxx-cxxabi ;; x86_64-apple-system-noexceptions) @@ -371,7 +371,7 @@ x86_64-apple-system-noexceptions) generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/apple-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="apple-libc++-shared.cfg.in" check-cxx-cxxabi ;; x86_64-apple-system-backdeployment-*) @@ -405,7 +405,7 @@ x86_64-apple-system-backdeployment-*) ;; benchmarks) clean - generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + generate-cmake -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-benchmarks ;; documentation) @@ -416,7 +416,6 @@ documentation) ${NINJA} -vC "${BUILD_DIR}" docs-libcxx-html ;; unified-standalone) - clean echo "--- Generating CMake" @@ -427,12 +426,11 @@ unified-standalone) -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi;libunwind" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; new-standalone) - clean echo "--- Generating CMake" @@ -443,7 +441,7 @@ new-standalone) -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; @@ -466,7 +464,7 @@ runtimes-build) -DLLVM_RUNTIME_TARGETS="x86_64-unknown-linux-gnu" \ -DLLVM_ENABLE_ASSERTIONS=ON \ -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Generic-modules.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" echo "+++ Running the libc++ and libc++abi tests" ${NINJA} -C "${BUILD_DIR}" check-runtimes @@ -476,7 +474,7 @@ runtimes-build) ;; legacy-test-config) clean - generate-cmake -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/legacy.cfg.in" + generate-cmake -DLIBCXX_TEST_CONFIG="legacy.cfg.in" check-cxx-cxxabi ;; legacy-standalone) @@ -523,7 +521,7 @@ legacy-standalone) aarch64) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; aarch64-noexceptions) @@ -531,33 +529,33 @@ aarch64-noexceptions) generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake" \ -DLIBCXX_ENABLE_EXCEPTIONS=OFF \ -DLIBCXXABI_ENABLE_EXCEPTIONS=OFF \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; # Aka Armv8 32 bit armv8) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Arm.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; armv8-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv8Thumb-noexceptions.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; # Armv7 32 bit. One building Arm only one Thumb only code. armv7) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Arm.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; armv7-noexceptions) clean generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Armv7Thumb-noexceptions.cmake" \ - -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/llvm-libc++-shared.cfg.in" + -DLIBCXX_TEST_CONFIG="llvm-libc++-shared.cfg.in" check-cxx-cxxabi ;; windows-dll) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt index cee2aa675d9cd..366dcc9fbaf85 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -177,7 +177,11 @@ option(LIBCXXABI_HERMETIC_STATIC_LIBRARY "Do not export any symbols from the static library." OFF) set(LIBCXXABI_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING - "The Lit testing configuration to use when running the tests.") + "The path to the Lit testing configuration to use when running the tests. + If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxx/test/configs'.") +if (NOT IS_ABSOLUTE "${LIBCXXABI_TEST_CONFIG}") + set(LIBCXXABI_TEST_CONFIG "${LIBCXXABI_LIBCXX_PATH}/test/configs/${LIBCXXABI_TEST_CONFIG}") +endif() set(LIBCXXABI_TEST_PARAMS "" CACHE STRING "A list of parameters to run the Lit test suite with.") diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt index 16331d948b124..9b55195b83986 100644 --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -86,7 +86,11 @@ set(LIBUNWIND_TEST_LINKER_FLAGS "" CACHE STRING set(LIBUNWIND_TEST_COMPILER_FLAGS "" CACHE STRING "Additional compiler flags for test programs.") set(LIBUNWIND_TEST_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/test/lit.site.cfg.in" CACHE STRING - "The Lit testing configuration to use when running the tests.") + "The path to the Lit testing configuration to use when running the tests. + If a relative path is provided, it is assumed to be relative to '<monorepo>/libcxx/test/configs'.") +if (NOT IS_ABSOLUTE "${LIBUNWIND_TEST_CONFIG}") + set(LIBUNWIND_TEST_CONFIG "${LIBUNWIND_LIBCXX_PATH}/test/configs/${LIBUNWIND_TEST_CONFIG}") +endif() set(LIBUNWIND_TEST_PARAMS "" CACHE STRING "A list of parameters to run the Lit test suite with.") _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits