Make changes to CMake to support SP math default.

We recently made SP math the default big integer math library. Some changes to
the CMake code are needed for this to work.
This commit is contained in:
Hayden Roche 2022-07-06 14:14:12 -07:00
parent ded3f4e9b6
commit d9bf39ffaa
2 changed files with 11 additions and 22 deletions

View File

@ -1425,24 +1425,9 @@ endif()
# - wolfCrypt only
# fastmath
set(FASTMATH_DEFAULT "no")
if(("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64") OR
("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64"))
set(FASTMATH_DEFAULT "yes")
endif()
if(WOLFSSL_LINUXKM_DEFAULTS)
set(FASTMATH_DEFAULT "no")
endif()
if(WOLFSSL_SP_MATH)
set(FASTMATH_DEFAULT "no")
endif()
add_option("WOLFSSL_FAST_MATH"
"Enable fast math ops (default: enabled on x86_64/aarch64)"
${FASTMATH_DEFAULT} "yes;no")
"Enable fast math ops (default: disabled)"
"no" "yes;no")
if(WOLFSSL_FAST_MATH)
# turn off fastmath if leanpsk on or asn off (w/o DH and ECC)
@ -1468,6 +1453,11 @@ endif()
# TODO: - Fast huge math
# SP math all
add_option("WOLFSSL_SP_MATH_ALL"
"Enable Single Precision math implementation for full algorithm suite (default: enabled)"
"yes" "yes;no")
# Enable examples, used to disable examples
if(WOLFSSL_LINUX_KM)
set(EXAMPLES_DEFAULT "no")

View File

@ -266,7 +266,7 @@ function(generate_build_flags)
if(WOLFSSL_SP_X86_64_ASM OR WOLFSSL_USER_SETTINGS)
set(BUILD_SP_X86_64 "yes" PARENT_SCOPE)
endif()
if(WOLFSSL_SP_MATH OR WOLFSSL_USER_SETTINGS)
if(WOLFSSL_SP_MATH OR WOLFSSL_SP_MATH_ALL OR WOLFSSL_USER_SETTINGS)
set(BUILD_SP_INT "yes" PARENT_SCOPE)
endif()
set(BUILD_FAST_RSA ${WOLFSSL_FAST_RSA} PARENT_SCOPE)
@ -541,14 +541,13 @@ function(generate_lib_src_list LIB_SOURCES)
list(APPEND LIB_SOURCES wolfcrypt/src/sp_arm64.c)
endif()
if(BUILD_SP_INT)
list(APPEND LIB_SOURCES wolfcrypt/src/sp_int.c)
endif()
if(BUILD_SP_ARM_CORTEX)
list(APPEND LIB_SOURCES wolfcrypt/src/sp_cortexm.c)
endif()
endif()
if(BUILD_SP_INT)
list(APPEND LIB_SOURCES wolfcrypt/src/sp_int.c)
endif()
if(NOT BUILD_FIPS_V2)
if(BUILD_AES)