Merge pull request #3732 from ccawley2011/fix-arm

Fix compilation on ARM
This commit is contained in:
Weiyi Wang 2018-05-26 20:14:55 +03:00 committed by GitHub
commit 09982c3386
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 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()
#============================================================================