From c92637179a9702d19c2e2f154e77421c9489486f Mon Sep 17 00:00:00 2001 From: nindanaoto Date: Wed, 10 Apr 2024 08:23:59 +0000 Subject: [PATCH] more clever definitions --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f60b68..8f63dcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() @@ -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 @@ -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