[Openmp-commits] [openmp] [OpenMP][omptest] Skip omptest build if LLVM_INCLUDE_TESTS=OFF (PR #155020)

Michael Halkenhäuser via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 22 12:29:57 PDT 2025


https://github.com/mhalk created https://github.com/llvm/llvm-project/pull/155020

Add / expand early exit in CMakeLists.txt if LLVM_INCLUDE_TESTS is 'OFF'

>From 4011bd8802cd59fdc92770fa6ef9d0cdc49deb45 Mon Sep 17 00:00:00 2001
From: Michael Halkenhaeuser <MichaelGerald.Halkenhauser at amd.com>
Date: Fri, 22 Aug 2025 14:27:28 -0500
Subject: [PATCH] [OpenMP][omptest] Skip omptest build if
 LLVM_INCLUDE_TESTS=OFF

Add / expand early exit in CMakeLists.txt if LLVM_INCLUDE_TESTS is 'OFF'
---
 openmp/tools/omptest/CMakeLists.txt | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/openmp/tools/omptest/CMakeLists.txt b/openmp/tools/omptest/CMakeLists.txt
index 6bc32ab099922..10c0cd98ccbc2 100644
--- a/openmp/tools/omptest/CMakeLists.txt
+++ b/openmp/tools/omptest/CMakeLists.txt
@@ -13,8 +13,8 @@ option(LIBOMPTEST_BUILD_STANDALONE
 option(LIBOMPTEST_BUILD_UNITTESTS
        "Build ompTest's unit tests, requires GoogleTest." OFF)
 
-# In absence of corresponding OMPT support: exit early
-if(NOT ${LIBOMP_OMPT_SUPPORT})
+# Exit early if OMPT support or LLVM-tests were disabled by the user.
+if((NOT ${LIBOMP_OMPT_SUPPORT}) OR (NOT ${LLVM_INCLUDE_TESTS}))
   return()
 endif()
 
@@ -61,12 +61,7 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
     set(LIBOMPTEST_BUILD_STANDALONE OFF)
   endif()
 
-  # Make sure target llvm_gtest is available
-  if (NOT TARGET llvm_gtest)
-    message(FATAL_ERROR "Required target not found: llvm_gtest")
-  endif()
-
-  # Add llvm_gtest as dependency
+  # Add dependency llvm_gtest; emits error if unavailable.
   add_dependencies(omptest llvm_gtest)
 
   # Link llvm_gtest as whole-archive to expose required symbols



More information about the Openmp-commits mailing list