[llvm-branch-commits] [openmp] users/jplehr/omptest package install (PR #237201)
Jan Patrick Lehr via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Oct 30 05:31:19 PDT 2026
https://github.com/jplehr created https://github.com/llvm/llvm-project/pull/237201
<sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
>From f1ed01b72857fc84b263d3c979fbd74beea4d14d Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Thu, 3 Sep 2026 18:16:43 +0000
Subject: [PATCH 1/2] [OpenMP][omptest] Install the package config at a
target-independent path
Make it predictable where the installed cmake config lands in presence
of LLVM_ENABLE_PER_TARGET_RUNTIME_DIR.
Install it under lib${LLVM_LIBDIR_SUFFIX}/cmake, which does not depend
on the target. The library itself stays next to libomp; the generated files
resolve their prefix relative to the config, so nothing else changes.
Assisted-by: Claude Opus 5 <noreply at anthropic.com>
---
openmp/tools/omptest/CMakeLists.txt | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/openmp/tools/omptest/CMakeLists.txt b/openmp/tools/omptest/CMakeLists.txt
index 13dd5cc2ebbe8..f962889f280b3 100644
--- a/openmp/tools/omptest/CMakeLists.txt
+++ b/openmp/tools/omptest/CMakeLists.txt
@@ -139,7 +139,10 @@ target_include_directories(omptest PUBLIC
target_compile_features(omptest PRIVATE cxx_std_17)
# Perform package configuration.
-set(OMPTEST_CONFIG_INSTALL_DIR "${OPENMP_INSTALL_LIBDIR}/cmake/openmp/omptest")
+# Keep the config at a target-independent path so consumers can find it
+# without knowing the host triple.
+set(OMPTEST_CONFIG_INSTALL_DIR
+ "lib${LLVM_LIBDIR_SUFFIX}/cmake/openmp/omptest")
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/omptest-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/omptest-config.cmake
>From 8d59873478f60bedec1ea2a71f586a726f7b3103 Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Thu, 3 Sep 2026 18:16:53 +0000
Subject: [PATCH 2/2] [OpenMP][omptest] Export the standalone build mode to
library users
OmptTester.h picks its test-case implementation from
OPENMP_LIBOMPTEST_BUILD_STANDALONE, but the definition was PRIVATE and never
reached users of an installed ompTest: they pulled in the GoogleTest variant
against a standalone libomptest and failed to link.
Make it PUBLIC so the exported target carries it, and consumers select the
header matching the library without having to know how it was built.
Assisted-by: Claude Opus 5 <noreply at anthropic.com>
---
openmp/tools/omptest/CMakeLists.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/openmp/tools/omptest/CMakeLists.txt b/openmp/tools/omptest/CMakeLists.txt
index f962889f280b3..075f8a54fa95e 100644
--- a/openmp/tools/omptest/CMakeLists.txt
+++ b/openmp/tools/omptest/CMakeLists.txt
@@ -107,8 +107,9 @@ if ((NOT LIBOMPTEST_BUILD_STANDALONE) OR LIBOMPTEST_BUILD_UNITTESTS)
else()
message(STATUS "omptest build mode: standalone")
- # Add 'standalone' compile definitions
- target_compile_definitions(omptest PRIVATE
+ # PUBLIC: OmptTester.h selects the standalone variant on this macro, so
+ # consumers must see the same value the library was built with.
+ target_compile_definitions(omptest PUBLIC
-DOPENMP_LIBOMPTEST_BUILD_STANDALONE)
# Add 'standalone' source files
More information about the llvm-branch-commits
mailing list