Skip to content

Commit

Permalink
Fix compilation in OSX Catalina with OMP enabled
Browse files Browse the repository at this point in the history
- Explicitly add linker flags from OMP
  • Loading branch information
SergioRAgostinho committed Apr 11, 2020
1 parent 41a9d02 commit 8a50775
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
endif()

### ---[ Find universal dependencies

# OpenMP (optional)
find_package(OpenMP COMPONENTS C CXX)
if(OpenMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
Expand All @@ -299,6 +301,8 @@ if(OpenMP_FOUND)
else()
message(WARNING "Delay loading flag for OpenMP DLL is invalid.")
endif()
else()
link_libraries("${OpenMP_CXX_LIBRARIES}")
endif()
else()
message(STATUS "Not found OpenMP")
Expand Down

0 comments on commit 8a50775

Please sign in to comment.