Fix wrong handling of OpenMP on osx
This commit is contained in:
parent
9102c06356
commit
a10dd04dea
8
vendor/cryptopp/CMakeLists.txt
vendored
8
vendor/cryptopp/CMakeLists.txt
vendored
@ -13,14 +13,14 @@ if(NOT DISABLE_OPENMP)
|
|||||||
AND ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0") AND (CMAKE_VERSION VERSION_LESS "3.12.0")))
|
AND ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0") AND (CMAKE_VERSION VERSION_LESS "3.12.0")))
|
||||||
# Workaround because older cmake on apple doesn't support FindOpenMP
|
# Workaround because older cmake on apple doesn't support FindOpenMP
|
||||||
message(STATUS "Applying workaround for OSX OpenMP")
|
message(STATUS "Applying workaround for OSX OpenMP")
|
||||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-Xclang -fopenmp")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fopenmp")
|
||||||
target_link_libraries(cryptopp PRIVATE -lomp)
|
target_link_libraries(cryptopp PRIVATE -lomp)
|
||||||
else()
|
else()
|
||||||
message(STATUS "Using OpenMP")
|
|
||||||
find_package(OpenMP)
|
find_package(OpenMP)
|
||||||
if(OPENMP_FOUND)
|
if(OPENMP_FOUND)
|
||||||
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS})
|
message(STATUS "Using OpenMP library: ${OpenMP_CXX_LIBRARIES}")
|
||||||
target_link_libraries(cryptopp PRIVATE ${OpenMP_CXX_FLAGS})
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
|
target_link_libraries(cryptopp PRIVATE ${OpenMP_CXX_LIBRARIES})
|
||||||
else(OPENMP_FOUND)
|
else(OPENMP_FOUND)
|
||||||
message(FATAL_ERROR "Did not find OpenMP. Build with -DDISABLE_OPENMP=ON if you want to allow this and are willing to take the performance hit.")
|
message(FATAL_ERROR "Did not find OpenMP. Build with -DDISABLE_OPENMP=ON if you want to allow this and are willing to take the performance hit.")
|
||||||
endif(OPENMP_FOUND)
|
endif(OPENMP_FOUND)
|
||||||
|
Loading…
Reference in New Issue
Block a user