Commit 522a4084 authored by Ghislain MARY's avatar Ghislain MARY Committed by Ghislain MARY
Browse files

Only enable ASM when needed.

No related merge requests found
Showing with 7 additions and 1 deletion
......@@ -19,7 +19,7 @@ if(POLICY CMP0067)
endif()
project(liboqs C ASM)
project(liboqs C)
option(OQS_DIST_BUILD "Build distributable library with optimized code for several CPU microarchitectures. Enables run-time CPU feature detection." OFF)
option(OQS_BUILD_ONLY_LIB "Build only liboqs and do not expose build targets for tests, documentation, and pretty-printing available." OFF)
......@@ -111,6 +111,11 @@ endif()
include(.CMake/compiler_opts.cmake)
include(.CMake/alg_support.cmake)
# Enable ASM language only when needed
if(OQS_DIST_ARM64_V8_BUILD OR OQS_USE_ARM_NEON_INSTRUCTIONS OR OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USEPOPCNT_INSTRUCTIONS) OR BUILD_AVX2)
enable_language(ASM)
endif()
if(${OQS_USE_OPENSSL})
if(NOT DEFINED OPENSSL_ROOT_DIR)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Darwin")
......
......@@ -30,6 +30,7 @@ endif()
# We currently do not have a SHA3 AVX2 implementation that works on Windows
if(BUILD_AVX2 AND CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
add_library(xkcp_low_keccakp_1600_avx2 OBJECT KeccakP-1600/avx2/KeccakP-1600-AVX2.S)
set_target_properties(xkcp_low_keccakp_1600_avx2 PROPERTIES LINKER_LANGUAGE ASM)
add_library(xkcp_low_keccakp_1600times4_avx2 OBJECT KeccakP-1600times4/avx2/KeccakP-1600-times4-SIMD256.c)
target_include_directories(xkcp_low_keccakp_1600times4_avx2 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/KeccakP-1600/avx2)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment