[Openmp-commits] [openmp] [OpenMP] Add libomp unit test infrastructure (PR #168063)
Michael Kruse via Openmp-commits
openmp-commits at lists.llvm.org
Tue Dec 2 14:29:50 PST 2025
================
@@ -174,17 +174,28 @@ if(NOT WIN32)
endif()
# Add the OpenMP library
-libomp_get_ldflags(LIBOMP_CONFIGURED_LDFLAGS)
+# First, create an OBJECT library with all the runtime sources.
+# This allows both the main library and unit tests to link against the same
+# compiled objects.
+add_library(omp_objects OBJECT ${LIBOMP_SOURCE_FILES})
----------------
Meinersbur wrote:
While I don't think it is elegant to introduce an object library, I haven't come up with a better solution to have unittests access to non-exported symbols.
The comment above could be improved: Shared/static libraries also "link" to the same compiled objects. It is just that the unittests also need access to private symbols not visible to outside the shared library.
https://github.com/llvm/llvm-project/pull/168063
More information about the Openmp-commits
mailing list