[clang] [clang][cmake] Move perf-training out of CLANG_INCLUDE_TESTS (PR #192163)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 15 22:02:10 PDT 2026
https://github.com/markyang92 updated https://github.com/llvm/llvm-project/pull/192163
>From 3ee9308648b6022cb08b7cf3cefd1914c91193ca Mon Sep 17 00:00:00 2001
From: "mark.yang" <mark.yang at lge.com>
Date: Wed, 15 Apr 2026 08:29:40 +0900
Subject: [PATCH] [clang][cmake] Move perf-training out of CLANG_INCLUDE_TESTS
perf-training is a PGO profile collection and BOLT optimization tool,
not a test suite. Move add_subdirectory(utils/perf-training) out of the
CLANG_INCLUDE_TESTS block so it is available when CLANG_INCLUDE_TESTS=OFF.
The perf-training CMakeLists.txt is already guarded by
LLVM_BUILD_INSTRUMENTED and CLANG_BOLT, so it is a no-op in
non-PGO/non-BOLT builds.
Also fix lit.site.cfg.in to use LLVM_MAIN_SRC_DIR instead of
CMAKE_SOURCE_DIR for llvm_src_dir. In standalone builds,
CMAKE_SOURCE_DIR points to clang/, not llvm/, causing
llvm-support/build.test to fail.
---
clang/CMakeLists.txt | 3 ++-
clang/utils/perf-training/lit.site.cfg.in | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index 40506fc8a1546..25874ec1a0ba3 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -585,9 +585,10 @@ if( CLANG_INCLUDE_TESTS )
if(CLANG_BUILT_STANDALONE)
umbrella_lit_testsuite_end(check-all)
endif()
- add_subdirectory(utils/perf-training)
endif()
+add_subdirectory(utils/perf-training)
+
option(CLANG_INCLUDE_DOCS "Generate build targets for the Clang docs."
${LLVM_INCLUDE_DOCS})
if( CLANG_INCLUDE_DOCS )
diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in
index da81ec21a28a6..8f46f459dd4a1 100644
--- a/clang/utils/perf-training/lit.site.cfg.in
+++ b/clang/utils/perf-training/lit.site.cfg.in
@@ -9,7 +9,7 @@ config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@LLVM_TARGET_TRIPLE@"
config.python_exe = "@Python3_EXECUTABLE@"
config.cmake_exe = "@CMAKE_COMMAND@"
-config.llvm_src_dir ="@CMAKE_SOURCE_DIR@"
+config.llvm_src_Dir = "@LLVM_MAIN_SRC_DIR@"
config.cmake_generator ="@CMAKE_GENERATOR@"
config.use_llvm_build = @CLANG_PGO_TRAINING_USE_LLVM_BUILD@
More information about the cfe-commits
mailing list