-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathCMakeLists.txt
85 lines (65 loc) · 1.69 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.14)
include(GNUInstallDirs)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_EXTENSIONS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_EXTENSIONS ON)
set(PROJECT_VERSION 0.1.0)
project(aztec-trusted-setup)
set(include_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(private_include_dir ${PROJECT_SOURCE_DIR}/src)
set(DEPENDS_DIR ${PROJECT_SOURCE_DIR}/depends)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
### SETUP
# Create a directory to store the trusted setup output
add_custom_target(create-setup-db-directory ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/setup_db)
### DEPENDENCIES
# GMP
find_path(GMP_INCLUDE_DIR NAMES gmp.h)
find_library(GMP_LIBRARIES NAMES gmp libgmp)
find_library(GMPXX_LIBRARIES NAMES gmpxx libgmpxx)
add_compile_options(-Werror -Wall -Wextra)
add_compile_options(-fno-stack-protector)
#add_compile_options(-Wno-unused-const-variable)
option(
ENABLE_LIBFF_PROFILING
"Enable libff performance profiling"
OFF
)
if("${ENABLE_LIBFF_PROFILING}")
add_definitions(-DENABLE_LIBFF_PROFILING)
endif()
# SET LIBFF CURVE TO ALT_BN128
set(
CURVE
"ALT_BN128"
CACHE
STRING
"Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6"
)
set(USE_ASM ON)
# DEFAULT MULTICORE OFF
option(
MULTICORE
"Enable parallelized execution, using OpenMP"
OFF
)
# DEFAULT PROCPS OFF
option(
WITH_PROCPS
"Use procps for memory profiling"
OFF
)
# Seriously, turn this damn thing off
add_definitions(
-DNO_PROCPS
)
add_subdirectory(depends)
add_subdirectory(src)
option(SETUP_TESTING "Build tests" ON)
if(SETUP_TESTING)
enable_testing()
add_subdirectory(test)
endif()