@ -1,5 +1,5 @@
add_library ( lokinet- cryptography
add_library ( lokinet- libntrup
S T A T I C
l i b n t r u p / s r c / n t r u . c p p
l i b n t r u p / s r c / r e f / r a n d o m s m a l l . c
@ -20,7 +20,7 @@ add_library(lokinet-cryptography
l i b n t r u p / s r c / r e f / r q . c
)
target_include_directories ( lokinet- cryptography PUBLIC ${ CMAKE_CURRENT_SOURCE_DIR } /libntrup/include )
target_include_directories ( lokinet- libntrup PUBLIC ${ CMAKE_CURRENT_SOURCE_DIR } /libntrup/include )
# T h e a v x i m p l e m e n t a t i o n u s e s r u n t i m e C P U f e a t u r e d e t e c t i o n t o e n a b l e i t s e l f , s o w e * a l w a y s * w a n t t o
# c o m p i l e i t w i t h a v x 2 / f m a s u p p o r t w h e n s u p p o r t e d b y t h e c o m p i l e r e v e n i f w e a r e n ' t c o m p i l i n g w i t h
@ -48,19 +48,19 @@ include(CheckCXXCompilerFlag)
check_cxx_compiler_flag ( -mavx2 COMPILER_SUPPORTS_AVX2 )
check_cxx_compiler_flag ( -mfma COMPILER_SUPPORTS_FMA )
if ( COMPILER_SUPPORTS_AVX2 AND COMPILER_SUPPORTS_FMA AND ( NOT ANDROID ) )
target_sources ( lokinet- cryptography PRIVATE ${ NTRU_AVX_SRC } )
target_sources ( lokinet- libntrup PRIVATE ${ NTRU_AVX_SRC } )
set_property ( SOURCE ${ NTRU_AVX_SRC } APPEND PROPERTY COMPILE_FLAGS "-mavx2 -mfma" )
message ( STATUS "Building libntrup with runtime AVX2/FMA support" )
else ( )
target_sources ( lokinet- cryptography PRIVATE libntrup/src/noavx-stubs.c )
target_sources ( lokinet- libntrup PRIVATE libntrup/src/noavx-stubs.c )
message ( STATUS "Not building with libntrup runtime AVX2/FMA support (either this architecture doesn't support them, or your compile doesn't support the -mavx2 -mfma flags" )
endif ( )
enable_lto ( lokinet- cryptography )
enable_lto ( lokinet- libntrup )
if ( WARNINGS_AS_ERRORS )
target_compile_options ( lokinet- cryptography PUBLIC -Wall -Wextra -Werror )
target_compile_options ( lokinet- libntrup PUBLIC -Wall -Wextra -Werror )
endif ( )
target_link_libraries ( lokinet- cryptography PUBLIC sodium )
target_link_libraries ( lokinet- libntrup PUBLIC sodium )