From 2ad475830e042e814bc29a8b600d825adce919f2 Mon Sep 17 00:00:00 2001 From: Walter Huf Date: Thu, 14 Dec 2023 19:09:57 -0800 Subject: [PATCH] cmake: Expand generator exps in libobs pkgconfig Non-x86 platforms use a generator expression to add the -fopenmp flag so render this expression before writing out any pkgconfig file Should fix #7972 and #7990 --- cmake/Modules/CompilerConfig.cmake | 5 +++-- cmake/Modules/ObsHelpers_Linux.cmake | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/CompilerConfig.cmake b/cmake/Modules/CompilerConfig.cmake index 849d19de75ccf2..ee10d62ad72a31 100644 --- a/cmake/Modules/CompilerConfig.cmake +++ b/cmake/Modules/CompilerConfig.cmake @@ -163,8 +163,9 @@ else() check_c_compiler_flag("-fopenmp-simd" C_COMPILER_SUPPORTS_OPENMP_SIMD) check_cxx_compiler_flag("-fopenmp-simd" CXX_COMPILER_SUPPORTS_OPENMP_SIMD) set(ARCH_SIMD_FLAGS - -DSIMDE_ENABLE_OPENMP "$<$,$>:-fopenmp-simd>" - "$<$,$>:-fopenmp-simd>") + -DSIMDE_ENABLE_OPENMP + "$<$,$>,$,$>>:-fopenmp-simd>" + ) endif() endif() diff --git a/cmake/Modules/ObsHelpers_Linux.cmake b/cmake/Modules/ObsHelpers_Linux.cmake index ced6c9ba3ec837..26991e286597a6 100644 --- a/cmake/Modules/ObsHelpers_Linux.cmake +++ b/cmake/Modules/ObsHelpers_Linux.cmake @@ -58,7 +58,12 @@ function(export_target_pkgconf target) set(_TARGET_OPTIONS "") endif() - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/${target}.pc.in" "${target}.pc" @ONLY) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/${target}.pc.in" + "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/${target}.pc.in2" @ONLY) + file( + GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${target}.pc" + INPUT "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/${target}.pc.in2") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${target}.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endfunction()