forked from EOSIO/eosio.cdt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (36 loc) · 1.89 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
cmake_minimum_required(VERSION 3.5)
project(eosio_wasm_sdk)
set(VERSION_MAJOR 1)
set(VERSION_MINOR 1)
set(VERSION_PATCH 1)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk")
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/eosio.wasmsdk")
elseif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr/local")
message(WARNING "CMAKE_INSTALL_PREFIX is explicitly set to /usr/local. This is not recommended.")
endif()
include(GNUInstallDirs)
include(ClangExternalProject.txt)
add_subdirectory(external)
set(WASM_SDK_BUILD true)
configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchainBuild.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/EosioWasmToolchain.cmake @ONLY)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/lib/cmake")
include(EosioWasmToolchain)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
if ("${CORE_SYMBOL_NAME}" STREQUAL "")
set( CORE_SYMBOL_NAME "SYS" )
endif()
string(TOUPPER ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME)
string(LENGTH ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME_LENGTH)
if (CORE_SYMBOL_NAME_LENGTH GREATER 7)
message(FATAL_ERROR "CORE_SYMBOL_NAME length must be between 1 and 7 characters")
endif()
add_subdirectory(libraries)
include(InstallClang.txt)
message( STATUS "Using '${CORE_SYMBOL_NAME}' as CORE symbol name" )
# install examples
#install(DIRECTORY examples DESTINATION "${CMAKE_INSTALL_PREFIX}")
configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake)
configure_file(${CMAKE_SOURCE_DIR}/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.imports COPYONLY)
install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CMAKE_INSTALL_PREFIX})