This repository has been archived by the owner on Nov 29, 2023. It is now read-only.
forked from idyllicvision/rapidsnark
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
65 lines (43 loc) · 1.7 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
cmake_minimum_required(VERSION 3.5)
include(cmake/platform.cmake)
set(USE_ASM ON CACHE BOOL "Use asm implementation for Fr and Fq")
set(USE_OPENMP ON CACHE BOOL "Use OpenMP")
project(rapidsnark LANGUAGES CXX ASM)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
message("USE_ASM=" ${USE_ASM})
message("USE_OPENMP=" ${USE_OPENMP})
message("CMAKE_CROSSCOMPILING=" ${CMAKE_CROSSCOMPILING})
message("GMP_PREFIX=" ${GMP_PREFIX})
message("GMP_INCLUDE_DIR=" ${GMP_INCLUDE_DIR})
message("GMP_LIB_DIR=" ${GMP_LIB_DIR})
if (NOT EXISTS ${GMP_INCLUDE_FILE_FULLPATH})
message("WARNING: ${GMP_INCLUDE_FILE_FULLPATH} is not found and so system ${GMP_INCLUDE_FILE} is used.")
endif()
if (NOT EXISTS ${GMP_LIB_FILE_FULLPATH})
message("WARNING: ${GMP_LIB_FILE_FULLPATH} is not found and so system ${GMP_LIB_FILE} is used.")
set(GMP_LIB gmp)
endif()
include_directories(BEFORE ${GMP_INCLUDE_DIR})
if(USE_OPENMP)
find_package(OpenMP)
if(OpenMP_CXX_FOUND)
if(TARGET_PLATFORM MATCHES "android")
message("OpenMP is used")
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
message("OpenMP is used")
else()
set(OpenMP_CXX_FOUND FALSE)
message("OpenMP is not used")
endif()
endif()
endif()
add_subdirectory(src)
install(TARGETS prover rapidsnark rapidsnarkStatic rapidsnarkStaticFrFq test_prover fr fq
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/app
LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(FILES "${GMP_LIB_DIR}/${GMP_LIB_FILE}"
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
install(FILES src/prover.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include)