summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2022-11-18 12:08:55 +0200
committerFlorian Festi <ffesti@redhat.com>2022-11-18 11:47:05 +0100
commitd0867bcea9238d2d6438a6e987c5becb0c4f0344 (patch)
tree6edea1f9ba53c1fbdb336985b7a2eb8cd359a971 /build
parent3c4f309e413ee8eda9f1381f2c20931c802adec8 (diff)
downloadrpm-d0867bcea9238d2d6438a6e987c5becb0c4f0344.tar.gz
Fix OpenMP enablement in librpmbuild (broken by cmake transition)
find_package(OpenMP) does not actually set any compiler flags in the build environment, we need to do this manually.
Diffstat (limited to 'build')
-rw-r--r--build/CMakeLists.txt3
-rw-r--r--build/build.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt
index 345f68207..6626bdcce 100644
--- a/build/CMakeLists.txt
+++ b/build/CMakeLists.txt
@@ -30,7 +30,8 @@ if(WITH_CAP)
endif()
if(OpenMP_C_FOUND)
- target_link_libraries(librpmbuild PRIVATE ${OpenMP_C_LIBRARIES})
+ target_compile_options(librpmbuild PRIVATE ${OpenMP_C_FLAGS})
+ target_link_libraries(librpmbuild PRIVATE ${OpenMP_C_LIBRARIES})
endif()
diff --git a/build/build.c b/build/build.c
index 29afbdd4f..9cd569b83 100644
--- a/build/build.c
+++ b/build/build.c
@@ -472,7 +472,7 @@ static rpmRC buildSpec(rpmts ts, BTA_t buildArgs, rpmSpec spec, int what)
(void) unlink(spec->specFile);
exit:
-#if WITH_OPENMP
+#ifdef ENABLE_OPENMP
omp_set_num_threads(prev_threads);
#endif
freeStringBuf(sink);