[libcxx] [libcxxabi] [libunwind] [runtimes] Avoid cluttering the top-level build directory with test artifacts (PR #112717)

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 17 07:32:04 PDT 2024


https://github.com/ldionne created https://github.com/llvm/llvm-project/pull/112717

Instead of placing artifacts for testing the runtimes at <build>/test, place those artifacts at <build>/<project>/test. This prevents cluttering the build directory with the runtimes' test artifacts for everyone else.

As a drive-by, remove LIBCXX_BINARY_INCLUDE_DIR which wasn't used anymore.

>From 9735fca0792a1fb037190b5ed057e775a83f0acf Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Thu, 17 Oct 2024 10:29:58 -0400
Subject: [PATCH] [runtimes] Avoid cluttering the top-level build directory
 with test artifacts

Instead of placing artifacts for testing the runtimes at <build>/test,
place those artifacts at <build>/<project>/test. This prevents cluttering
the build directory with the runtimes' test artifacts for everyone else.

As a drive-by, remove LIBCXX_BINARY_INCLUDE_DIR which wasn't used anymore.
---
 libcxx/CMakeLists.txt                      | 3 ---
 libcxx/test/configs/cmake-bridge.cfg.in    | 2 +-
 libcxxabi/test/configs/cmake-bridge.cfg.in | 2 +-
 libunwind/test/configs/cmake-bridge.cfg.in | 2 +-
 4 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt
index 75c926f5432aea..6befb87e5556b4 100644
--- a/libcxx/CMakeLists.txt
+++ b/libcxx/CMakeLists.txt
@@ -19,7 +19,6 @@ set(CMAKE_FOLDER "libc++")
 
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
 
 include(GNUInstallDirs)
 include(WarningFlags)
@@ -443,8 +442,6 @@ else()
       "Path where target-specific libc++ headers should be installed.")
 endif()
 
-file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
-
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
diff --git a/libcxx/test/configs/cmake-bridge.cfg.in b/libcxx/test/configs/cmake-bridge.cfg.in
index bc9bb0e03911d4..139a6cafa2cfb3 100644
--- a/libcxx/test/configs/cmake-bridge.cfg.in
+++ b/libcxx/test/configs/cmake-bridge.cfg.in
@@ -20,7 +20,7 @@ config.name = os.path.basename('@LIBCXX_TEST_CONFIG@')
 config.test_source_root = os.path.join('@LIBCXX_SOURCE_DIR@', 'test')
 config.test_format = libcxx.test.format.CxxStandardLibraryTest()
 config.recursiveExpansionLimit = 10
-config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
+config.test_exec_root = os.path.join('@LIBCXX_BINARY_DIR@', 'test')
 
 # Add substitutions for bootstrapping the test suite configuration
 config.substitutions.append(('%{libcxx-dir}', '@LIBCXX_SOURCE_DIR@'))
diff --git a/libcxxabi/test/configs/cmake-bridge.cfg.in b/libcxxabi/test/configs/cmake-bridge.cfg.in
index b00eb642750c9b..1dd6b3367e4387 100644
--- a/libcxxabi/test/configs/cmake-bridge.cfg.in
+++ b/libcxxabi/test/configs/cmake-bridge.cfg.in
@@ -21,7 +21,7 @@ config.name = os.path.basename('@LIBCXXABI_TEST_CONFIG@')
 config.test_source_root = os.path.join('@LIBCXXABI_SOURCE_DIR@', 'test')
 config.test_format = libcxx.test.format.CxxStandardLibraryTest()
 config.recursiveExpansionLimit = 10
-config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
+config.test_exec_root = os.path.join('@LIBCXXABI_BINARY_DIR@', 'test')
 
 # TODO: This is a non-standard Lit attribute and we should have another way of accessing this.
 config.host_triple = '@LLVM_HOST_TRIPLE@'
diff --git a/libunwind/test/configs/cmake-bridge.cfg.in b/libunwind/test/configs/cmake-bridge.cfg.in
index f627f401f9f7b5..20b61e788ab180 100644
--- a/libunwind/test/configs/cmake-bridge.cfg.in
+++ b/libunwind/test/configs/cmake-bridge.cfg.in
@@ -20,7 +20,7 @@ config.name = os.path.basename('@LIBUNWIND_TEST_CONFIG@')
 config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
 config.test_format = libcxx.test.format.CxxStandardLibraryTest()
 config.recursiveExpansionLimit = 10
-config.test_exec_root = os.path.join('@CMAKE_BINARY_DIR@', 'test')
+config.test_exec_root = os.path.join('@LIBUNWIND_BINARY_DIR@', 'test')
 
 # Add a few features that are common to all the configurations
 if @LIBUNWIND_USES_ARM_EHABI@:



More information about the cfe-commits mailing list