mirror of
https://github.com/libtom/libtomcrypt
synced 2026-08-25 20:26:07 -04:00
cmake: Add TomsFastMath support
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
parent
5330cd1d9b
commit
3f33ccf181
1 changed files with 12 additions and 0 deletions
|
|
@ -33,6 +33,7 @@ include(sources.cmake)
|
|||
# Options
|
||||
#-----------------------------------------------------------------------------
|
||||
option(WITH_LTM "Build with support for libtommath" TRUE)
|
||||
option(WITH_TFM "Build with support for tomsfastmath" FALSE)
|
||||
option(WITH_GMP "Build with support for GNU Multi Precision Arithmetic Library" FALSE)
|
||||
set(MPI_PROVIDER "LTM" CACHE STRING "Build tests and demos against 'LTM', 'TFM' or 'GMP', default is LTM")
|
||||
option(BUILD_SHARED_LIBS "Build shared library and only the shared library if \"ON\", default is static" OFF)
|
||||
|
|
@ -138,6 +139,17 @@ if(WITH_LTM)
|
|||
target_link_libraries(${PROJECT_NAME} PUBLIC libtommath)
|
||||
list(APPEND MPI_PROVIDERS -ltommath)
|
||||
endif()
|
||||
# tomsfastmath
|
||||
if(WITH_TFM)
|
||||
find_package(tomsfastmath 0.13.1 REQUIRED)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC TFM_DESC)
|
||||
if(MPI_PROVIDER MATCHES "TFM")
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC USE_TFM)
|
||||
endif()
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC tomsfastmath)
|
||||
list(APPEND MPI_PROVIDERS -ltfm)
|
||||
endif()
|
||||
# GNU MP
|
||||
if(WITH_GMP)
|
||||
pkg_check_modules(GMP REQUIRED gmp>=6.1.2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue