-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
77 lines (64 loc) · 2.1 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_BUILD_TYPE Debug)
project(
libbbs
VERSION 0.1
LANGUAGES C)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(CheckCCompilerFlag OPTIONAL)
include(CTest)
install(DIRECTORY "${CMAKE_SOURCE_DIR}/${CMAKE_INSTALL_INCLUDEDIR}"
DESTINATION ${CMAKE_INSTALL_PREFIX})
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
set(CMAKE_BUILD_WITH_RPATH TRUE)
set(RELIC_CFLAGS
"-O3 -fomit-frame-pointer -fPIC"
CACHE INTERNAL "")
check_c_compiler_flag("-finline-small-functions" INLINE_SMALL_FUNCS_SUPPORTED)
if(INLINE_SMALL_FUNCS_SUPPORTED)
set(RELIC_CFLAGS
"${RELIC_CFLAGS} -finline-small-functions"
CACHE INTERNAL "")
else()
message(STATUS "-finline-small-functions not supported.")
endif()
SET(RELIC_ARITH "easy" CACHE STRING "The ARITH value for RELIC build")
message(STATUS "Relic CFLAGS: ${RELIC_CFLAGS}")
include(ExternalProject)
ExternalProject_Add(
relic
GIT_REPOSITORY https://github.com/relic-toolkit/relic.git
GIT_TAG 3b9a4a8
UPDATE_DISCONNECTED 1
STEP_TARGETS update
LIST_SEPARATOR ^^
INSTALL_COMMAND ""
CMAKE_ARGS -DWSIZE=64
-DRAND=UDEV
-DSHLIB=OFF
-DSTLIB=ON
-DSTBIN=OFF
-DTIMER=
-DCHECK=off
-DVERBS=off
-DARITH=${RELIC_ARITH}
-DFP_PRIME=381
"-DFP_METHD=BASIC^^COMBA^^COMBA^^MONTY^^MONTY^^JMPDS^^SLIDE"
"-DCFLAGS=${RELIC_CFLAGS}"
-DFP_PMERS=off
-DFP_QNRES=on
"-DFPX_METHD=INTEG^^INTEG^^LAZYR"
-DEP_PLAIN=off
-DEP_SUPER=off
"-DPP_METHD=LAZYR^^OATEP")
ExternalProject_Get_Property(relic BINARY_DIR)
ExternalProject_Get_Property(relic SOURCE_DIR)
include_directories(${SOURCE_DIR}/include)
find_program(MAKE_EXECUTABLE NAMES gmake make mingw32-make REQUIRED)
file(MAKE_DIRECTORY ${BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}) # avoid race
# condition
if(DEFINED LIBBBS_DEBUG)
add_compile_definitions(LIBBBS_DEBUG)
endif()
add_subdirectory(src)
add_subdirectory(test)