From d0867bcea9238d2d6438a6e987c5becb0c4f0344 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 18 Nov 2022 12:08:55 +0200 Subject: 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. --- build/CMakeLists.txt | 3 ++- build/build.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'build') 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); -- cgit v1.2.1