From 998bdae7f5ce8c5aa31b376592c9693fc95f02e3 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Mon, 30 Dec 2024 10:32:54 +0100 Subject: [PATCH] [MLGO] Only configure tests with LLVM_INCLUDE_TESTS (#121293) This allows downstream customers to remove all test directories and save quite some space when only building with LLVM_INCLUDE_TESTS=OFF. --- llvm/utils/mlgo-utils/CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/llvm/utils/mlgo-utils/CMakeLists.txt b/llvm/utils/mlgo-utils/CMakeLists.txt index 2f3920644b737b..d9b2bdc9bf60a9 100644 --- a/llvm/utils/mlgo-utils/CMakeLists.txt +++ b/llvm/utils/mlgo-utils/CMakeLists.txt @@ -1,9 +1,11 @@ -configure_lit_site_cfg( - "${CMAKE_CURRENT_SOURCE_DIR}/tests/lit.site.cfg.in" - "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg" -) +if(LLVM_INCLUDE_TESTS) + configure_lit_site_cfg( + "${CMAKE_CURRENT_SOURCE_DIR}/tests/lit.site.cfg.in" + "${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg" + ) -add_lit_testsuite(check-mlgo-utils "Running mlgo-utils tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS "FileCheck" "not" "count" "split-file" "yaml2obj" "llvm-objcopy" -) + add_lit_testsuite(check-mlgo-utils "Running mlgo-utils tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS "FileCheck" "not" "count" "split-file" "yaml2obj" "llvm-objcopy" + ) +endif()