From a10dd04dea53f8a096089e86e9ab99d89bdc07ce Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sun, 23 Sep 2018 22:22:47 -0700 Subject: [PATCH] Fix wrong handling of OpenMP on osx --- vendor/cryptopp/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/cryptopp/CMakeLists.txt b/vendor/cryptopp/CMakeLists.txt index c7a85785..99fade43 100644 --- a/vendor/cryptopp/CMakeLists.txt +++ b/vendor/cryptopp/CMakeLists.txt @@ -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"))) # Workaround because older cmake on apple doesn't support FindOpenMP 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) else() - message(STATUS "Using OpenMP") find_package(OpenMP) if(OPENMP_FOUND) - set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}) - target_link_libraries(cryptopp PRIVATE ${OpenMP_CXX_FLAGS}) + message(STATUS "Using OpenMP library: ${OpenMP_CXX_LIBRARIES}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") + target_link_libraries(cryptopp PRIVATE ${OpenMP_CXX_LIBRARIES}) 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.") endif(OPENMP_FOUND)