1
0
Fork 0

cryptopp: Fix compilation on non-x86/x86_64 systems

This commit is contained in:
Cameron Cawley 2018-05-13 11:34:32 +01:00
parent 39fce60145
commit 46f43bc4f7
1 changed files with 12 additions and 5 deletions

View File

@ -189,13 +189,20 @@ if(MSVC AND NOT CRYPTOPP_DISABLE_ASM)
endif()
if ((CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT CRYPTOPP_DISABLE_ASM)
if(${CMAKE_GENERATOR} MATCHES ".*ARM")
message(STATUS "Disabling ASM because ARM is specified as target platform.")
else()
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/rijndael-simd.cpp PROPERTIES COMPILE_FLAGS "-msse4.1 -maes")
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/sha-simd.cpp PROPERTIES COMPILE_FLAGS "-msse4.2 -msha")
check_cxx_compiler_flag(-msse2 CRYPTOPP_HAS_MSSE2)
check_cxx_compiler_flag(-msse4.1 CRYPTOPP_HAS_MSSE41)
check_cxx_compiler_flag(-msse4.2 CRYPTOPP_HAS_MSSE42)
check_cxx_compiler_flag(-maes CRYPTOPP_HAS_MAES)
check_cxx_compiler_flag(-msha CRYPTOPP_HAS_MSHA)
if (CRYPTOPP_HAS_MSSE2)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/sse-simd.cpp PROPERTIES COMPILE_FLAGS "-msse2")
endif()
if (CRYPTOPP_HAS_MSSE41 AND CRYPTOPP_HAS_MAES)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/rijndael-simd.cpp PROPERTIES COMPILE_FLAGS "-msse4.1 -maes")
endif()
if (CRYPTOPP_HAS_MSSE42 AND CRYPTOPP_HAS_MSHA)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/cryptopp/sha-simd.cpp PROPERTIES COMPILE_FLAGS "-msse4.2 -msha")
endif()
endif()
#============================================================================