From 9c98c5d7885cc0cefb2cba2b9c28be4d44e30ee9 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Sat, 19 May 2018 14:18:35 -0700 Subject: [PATCH] Build cryptopp with OpenMP --- vendor/cryptopp/CMakeLists.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/vendor/cryptopp/CMakeLists.txt b/vendor/cryptopp/CMakeLists.txt index f8c9550a..94b384ff 100644 --- a/vendor/cryptopp/CMakeLists.txt +++ b/vendor/cryptopp/CMakeLists.txt @@ -1,12 +1,23 @@ project(mycryptopp) +add_library(cryptopp dummy.cpp) +target_include_directories(cryptopp SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +find_package(OpenMP) +if(OPENMP_FOUND) + message(STATUS "Building crypto++ with OpenMP") + set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}) + target_link_libraries(cryptopp PRIVATE ${OpenMP_CXX_FLAGS}) +else(OPENMP_FOUND) + message(WARN "Did not find OpenMP. Performance might be degraded.") +endif(OPENMP_FOUND) + + set(BUILD_TESTING OFF) set(BUILD_DOCUMENTATION OFF) set(BUILD_SHARED OFF) set(BUILD_STATIC ON) add_subdirectory(cryptopp EXCLUDE_FROM_ALL) - -add_library(cryptopp dummy.cpp) target_link_libraries(cryptopp PRIVATE cryptopp-static) -target_include_directories(cryptopp SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +