From 944c7e175bc95e9f7f7a01fc09a45fc0657fcd17 Mon Sep 17 00:00:00 2001 From: Mikhail Paulyshka Date: Fri, 27 Oct 2023 17:06:07 +0300 Subject: [PATCH] cmake: add WOLFSSL_X86_64_BUILD_ASM option --- CMakeLists.txt | 1 + cmake/functions.cmake | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 642ad494c7..99fdc57ee0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1577,6 +1577,7 @@ endif() # Set processor-specific build macros if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86_64|AMD64") set(WOLFSSL_X86_64_BUILD ON) + add_option("WOLFSSL_X86_64_BUILD_ASM" "Build ASM files" "yes" "yes;no") list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_X86_64_BUILD") elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "aarch64|arm64") list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_AARCH64_BUILD") diff --git a/cmake/functions.cmake b/cmake/functions.cmake index 58ea8a37cf..757054a251 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -510,9 +510,10 @@ function(generate_lib_src_list LIB_SOURCES) endif() if(BUILD_SP_X86_64) - list(APPEND LIB_SOURCES - wolfcrypt/src/sp_x86_64.c - wolfcrypt/src/sp_x86_64_asm.S) + list(APPEND LIB_SOURCES wolfcrypt/src/sp_x86_64.c) + if(WOLFSSL_X86_64_BUILD_ASM) + list(APPEND LIB_SOURCES wolfcrypt/src/sp_x86_64_asm.S) + endif() endif() if(NOT BUILD_FIPS_V2 AND BUILD_SP_ARM32)