[Openmp-commits] [openmp] [OpenMP] Add libomp unit test infrastructure (PR #168063)

Michael Klemm via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 17 03:51:04 PST 2025


================
@@ -174,17 +174,26 @@ if(NOT WIN32)
 endif()
 
 # Add the OpenMP library
+
+# 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})
----------------
mjklemm wrote:

> There was even a ticket about statically linking `libomp`, but I don't think that was resolved.

There was a time when `libomp` linked statically before, but it caused all sorts of trouble when bringing in shared libraries that also linked against it.  So, that was abandoned for good reasons and probably shouldn't come back ever again. :-)

https://github.com/llvm/llvm-project/pull/168063


More information about the Openmp-commits mailing list