Skip to content

Commit

Permalink
abort on cmake config if openmp requested but not found (#2893)
Browse files Browse the repository at this point in the history
  • Loading branch information
gridley committed Mar 6, 2024
1 parent b75ccd5 commit aa0516f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,10 @@ endif()
if(NOT MSVC)

if(OPENMC_USE_OPENMP)
find_package(OpenMP)
if(OPENMP_FOUND)
# In CMake 3.9+, can use the OpenMP::OpenMP_CXX imported target
list(APPEND cxxflags ${OpenMP_CXX_FLAGS})
list(APPEND ldflags ${OpenMP_CXX_FLAGS})
endif()
find_package(OpenMP REQUIRED)
# In CMake 3.9+, can use the OpenMP::OpenMP_CXX imported target
list(APPEND cxxflags ${OpenMP_CXX_FLAGS})
list(APPEND ldflags ${OpenMP_CXX_FLAGS})
endif()

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
Expand Down

0 comments on commit aa0516f

Please sign in to comment.