forked from telosnetwork/telos.contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (50 loc) · 1.75 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
cmake_minimum_required(VERSION 3.5)
project(eosio_contracts)
set(VERSION_MAJOR 3)
set(VERSION_MINOR 2)
set(VERSION_PATCH 0)
set(VERSION_SUFFIX dev)
if(VERSION_SUFFIX)
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}")
else()
set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
endif()
message(STATUS "Building reference-contracts v${VERSION_FULL}")
include(ExternalProject)
find_package(cdt)
option(SYSTEM_CONFIGURABLE_WASM_LIMITS
"Enables use of the host functions activated by the CONFIGURABLE_WASM_LIMITS protocol feature" ON)
option(SYSTEM_BLOCKCHAIN_PARAMETERS
"Enables use of the host functions activated by the BLOCKCHAIN_PARAMETERS protocol feature" ON)
ExternalProject_Add(
contracts_project
SOURCE_DIR ${CMAKE_SOURCE_DIR}/contracts
BINARY_DIR ${CMAKE_BINARY_DIR}/contracts
CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release
-DCMAKE_TOOLCHAIN_FILE=${CDT_ROOT}/lib/cmake/cdt/CDTWasmToolchain.cmake
-DSYSTEM_CONFIGURABLE_WASM_LIMITS=${SYSTEM_CONFIGURABLE_WASM_LIMITS}
-DSYSTEM_BLOCKCHAIN_PARAMETERS=${SYSTEM_BLOCKCHAIN_PARAMETERS}
UPDATE_COMMAND ""
PATCH_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND ""
BUILD_ALWAYS 1)
if(APPLE)
set(OPENSSL_ROOT "/usr/local/opt/openssl")
elseif(UNIX)
set(OPENSSL_ROOT "/usr/include/openssl")
endif()
set(SECP256K1_ROOT "/usr/local")
if(APPLE)
set(OPENSSL_ROOT "/usr/local/opt/openssl")
elseif(UNIX)
set(OPENSSL_ROOT "/usr/include/openssl")
endif()
set(SECP256K1_ROOT "/usr/local")
option(BUILD_TESTS "Build unit tests" OFF)
if(BUILD_TESTS)
message(STATUS "Building unit tests.")
add_subdirectory(tests)
else()
message(STATUS "Unit tests will not be built. To build unit tests, set BUILD_TESTS to ON.")
endif()