Skip to content

Commit

Permalink
FindSleef: Use OpenMP in static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Nov 12, 2023
1 parent 30bca40 commit 47c06dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmake/modules/FindSleef.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ The following cache variables may also be set:

#]=======================================================================]

include(IsStaticLibrary)

find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(PC_Sleef QUIET sleef)
Expand Down Expand Up @@ -108,5 +110,15 @@ if(Sleef_FOUND)
INTERFACE_COMPILE_OPTIONS "${PC_Sleef_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${Sleef_INCLUDE_DIR}"
)

is_static_library(Sleef_IS_STATIC Sleef::sleef)
if(Sleef_IS_STATIC)
find_package(OpenMP)
if(OpenMP_FOUND)
set_property(TARGET Sleef::sleef APPEND PROPERTY INTERFACE_LINK_LIBRARIES
OpenMP::OpenMP_CXX
)
endif()
endif()
endif()
endif()

0 comments on commit 47c06dc

Please sign in to comment.