Skip to content

Commit

Permalink
more clever definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed Apr 10, 2024
1 parent 6eb1447 commit c926371
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,40 @@ option(USE_PERF "Use Google Profiler" OFF)

option(ENABLE_SHARED "Build as shared libraries" OFF)

set(TFHEpp_DEFINITIONS "" PARENT_SCOPE)

if(USE_RANDEN)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_RANDEN" PARENT_SCOPE)
add_compile_definitions(USE_RANDEN)
endif()

if(USE_80BIT_SECURITY)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_80BIT_SECURITY" PARENT_SCOPE)
add_compile_definitions(USE_80BIT_SECURITY)
elseif(USE_COMPRESS)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_COMPRESS" PARENT_SCOPE)
add_compile_definitions(USE_COMPRESS)
elseif(USE_CGGI19)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_CGGI19" PARENT_SCOPE)
add_compile_definitions(USE_CGGI19)
elseif(USE_CONCRETE)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_CONCRETE" PARENT_SCOPE)
add_compile_definitions(USE_CONCRETE)
elseif(USE_TFHE_RS)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_TFHE_RS" PARENT_SCOPE)
add_compile_definitions(USE_TFHE_RS)
elseif(USE_TERNARY_CMUX)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_TERNARY_CMUX;USE_TERNARY" PARENT_SCOPE)
add_compile_definitions(USE_TERNARY)
add_compile_definitions(USE_TERNARY_CMUX)
elseif(USE_TERNARY)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_TERNARY" PARENT_SCOPE)
add_compile_definitions(USE_TERNARY)
endif()

if(NOT USE_TERNARY)
if(USE_KEY_BUNDLE)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_KEY_BUNDLE" PARENT_SCOPE)
add_compile_definitions(USE_KEY_BUNDLE)
endif()
endif()
Expand All @@ -74,9 +85,11 @@ if(USE_AVX512)
endif()

if(USE_FFTW3)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_FFTW3" PARENT_SCOPE)
add_compile_definitions(USE_FFTW3)
add_subdirectory(thirdparties/fftw)
elseif(USE_SPQLIOX_AARCH64)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_SPQLIOX_AARCH64" PARENT_SCOPE)
add_compile_definitions(USE_SPQLIOX_AARCH64)
add_subdirectory(thirdparties/spqliox_aarch64)
# Check if the platform is macOS and the architecture is ARM64
Expand All @@ -88,6 +101,7 @@ else()
endif()

if(USE_HEXL)
set(TFHEpp_DEFINITIONS "${TFHEpp_DEFINITIONS};USE_HEXL" PARENT_SCOPE)
add_compile_definitions(USE_HEXL)
add_subdirectory(thirdparties/hexl)
# set(CMAKE_CXX_FLAGS "-march=native -O3 -g -funroll-loops -Wall -Wextra
Expand Down

0 comments on commit c926371

Please sign in to comment.