Skip to content

Commit

Permalink
fixing CMakeLists for non-x86 architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
archie bloom committed Dec 28, 2023
1 parent ef270ab commit 544338e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,26 @@ endif()

# Use processor extensions
# TODO: add exception if non-x86 platform
if (MSVC)
# The test will run only for x86-64 and AMD64 architectures
if (MSVC AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
add_compile_definitions(HAVE_INTRIN_H)
add_compile_definitions(USE_SSE2)
add_compile_definitions(HAVE_WMMINTRIN_H)
add_compile_definitions(HAVE_TMMINTRIN_H)
else()
if (SSE)
message(STATUS "Using SSE instructions")
if (SSE AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
message(STATUS "Using SSE instructions")
add_compile_definitions(HAVE_X86INTRIN_H)
add_compile_definitions(HAVE_TMMINTRIN_H)
add_compile_options(-mssse3 -mpclmul)
add_compile_definitions(HAVE_TMMINTRIN_H)
add_compile_options(-mssse3 -mpclmul)
endif()

if (SSE OR AESNI)
add_compile_definitions(HAVE_WMMINTRIN_H)
add_compile_definitions(HAVE_WMMINTRIN_H)
endif()
if (AESNI)
add_compile_options(-maes)

if (AESNI AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64" )
add_compile_options(-maes)
endif()
endif()

Expand Down

0 comments on commit 544338e

Please sign in to comment.