diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2022-11-18 12:08:55 +0200 |
---|---|---|
committer | Florian Festi <ffesti@redhat.com> | 2022-11-18 11:47:05 +0100 |
commit | d0867bcea9238d2d6438a6e987c5becb0c4f0344 (patch) | |
tree | 6edea1f9ba53c1fbdb336985b7a2eb8cd359a971 /build | |
parent | 3c4f309e413ee8eda9f1381f2c20931c802adec8 (diff) | |
download | rpm-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.txt | 3 | ||||
-rw-r--r-- | build/build.c | 2 |
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); |