Build with OpenMP on Windows

This commit is contained in:
Sebastian Messmer 2019-01-21 11:47:16 -08:00
parent 38397a2d86
commit 6042d4ba6b
1 changed files with 64 additions and 68 deletions

View File

@ -9,9 +9,6 @@ target_compile_definitions(cryptopp PUBLIC $<$<CONFIG:Debug>:CRYPTOPP_DEBUG>) #
add_compile_options($<$<CONFIG:Debug>:-DCRYPTOPP_DEBUG>) # add to stuff built in subdirectories (like the actual library)
if(NOT DISABLE_OPENMP)
if (MSVC)
message(WARNING "MSVC does not support the OpenMP 4.0 standard used by Crypto++. Disabling OpenMP. This can cause degraded performance.")
else()
find_package(OpenMP)
if (OPENMP_FOUND OR OPENMP_CXX_FOUND)
@ -78,7 +75,6 @@ if(NOT DISABLE_OPENMP)
message(STATUS "OpenMP flags: ${OpenMP_CXX_FLAGS}")
string(REPLACE " " ";" REPLACED_FLAGS ${OpenMP_CXX_FLAGS})
add_compile_options(${REPLACED_FLAGS})
endif()
else()
message(WARNING "OpenMP is disabled. This can cause degraded performance.")
endif()