-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
153 lines (148 loc) · 5.81 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
cmake_minimum_required(VERSION 3.4.1)
add_compile_definitions(MYMONERO_CORE_CUSTOM)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
project(MyMoneroLibAppCpp)
#
include_directories("src")
#
set(MYMONERO_LIBAPP_CPP "src/submodules/mymonero-libapp-cpp")
set(MYMONERO_LIBAPP_CPP_SRC "${MYMONERO_LIBAPP_CPP}/src")
include_directories("${MYMONERO_LIBAPP_CPP_SRC}")
include_directories("${MYMONERO_LIBAPP_CPP_SRC}/SendFunds/Controllers")
#
set(MYMONERO_CORE_CPP "${MYMONERO_LIBAPP_CPP_SRC}/mymonero-core-cpp")
set(MYMONERO_CORE_CPP_SRC "${MYMONERO_CORE_CPP}/src")
include_directories("${MYMONERO_CORE_CPP_SRC}")
#
set(MONERO_SRC "${MYMONERO_CORE_CPP}/contrib/monero-core-custom")
include_directories(${MONERO_SRC})
include_directories("${MONERO_SRC}/epee/include")
include_directories("${MONERO_SRC}/common")
include_directories("${MONERO_SRC}/vtlogger")
include_directories("${MONERO_SRC}/crypto")
include_directories("${MONERO_SRC}/cryptonote_basic")
include_directories("${MONERO_SRC}/multisig")
include_directories("${MONERO_SRC}/cryptonote_core")
include_directories("${MONERO_SRC}/cryptonote_protocol")
include_directories("${MONERO_SRC}/wallet")
include_directories("${MONERO_SRC}/rpc")
include_directories("${MONERO_SRC}/mnemonics")
include_directories("${MONERO_SRC}/contrib/libsodium/include") # support sodium/… paths
include_directories("${MONERO_SRC}/contrib/libsodium/include/sodium")
set(
SRC_FILES
#
src/index.cpp
#
src/emscr_SendFunds_bridge.hpp
src/emscr_SendFunds_bridge.cpp
#
${MYMONERO_CORE_CPP_SRC}/monero_address_utils.hpp
${MYMONERO_CORE_CPP_SRC}/monero_address_utils.cpp
${MYMONERO_CORE_CPP_SRC}/monero_paymentID_utils.hpp
${MYMONERO_CORE_CPP_SRC}/monero_paymentID_utils.cpp
${MYMONERO_CORE_CPP_SRC}/monero_key_image_utils.hpp
${MYMONERO_CORE_CPP_SRC}/monero_key_image_utils.cpp
${MYMONERO_CORE_CPP_SRC}/monero_fee_utils.hpp
${MYMONERO_CORE_CPP_SRC}/monero_fee_utils.cpp
${MYMONERO_CORE_CPP_SRC}/monero_transfer_utils.hpp
${MYMONERO_CORE_CPP_SRC}/monero_transfer_utils.cpp
${MYMONERO_CORE_CPP_SRC}/monero_fork_rules.hpp
${MYMONERO_CORE_CPP_SRC}/monero_fork_rules.cpp
${MYMONERO_CORE_CPP_SRC}/monero_wallet_utils.hpp
${MYMONERO_CORE_CPP_SRC}/monero_wallet_utils.cpp
${MYMONERO_CORE_CPP_SRC}/serial_bridge_index.hpp
${MYMONERO_CORE_CPP_SRC}/serial_bridge_index.cpp
${MYMONERO_CORE_CPP_SRC}/monero_send_routine.hpp
${MYMONERO_CORE_CPP_SRC}/monero_send_routine.cpp
${MYMONERO_CORE_CPP_SRC}/serial_bridge_utils.hpp
${MYMONERO_CORE_CPP_SRC}/serial_bridge_utils.cpp
${MYMONERO_CORE_CPP_SRC}/tools__ret_vals.hpp
${MYMONERO_CORE_CPP_SRC}/tools__ret_vals.cpp
#
${MYMONERO_LIBAPP_CPP_SRC}/SendFunds/Controllers/SendFundsFormSubmissionController.hpp
${MYMONERO_LIBAPP_CPP_SRC}/SendFunds/Controllers/SendFundsFormSubmissionController.cpp
#
${MONERO_SRC}/cryptonote_basic/account.cpp
${MONERO_SRC}/cryptonote_basic/cryptonote_basic.h
${MONERO_SRC}/cryptonote_basic/cryptonote_basic_impl.h
${MONERO_SRC}/cryptonote_basic/cryptonote_basic_impl.cpp
${MONERO_SRC}/cryptonote_basic/cryptonote_format_utils.h
${MONERO_SRC}/cryptonote_basic/cryptonote_format_utils.cpp
${MONERO_SRC}/cryptonote_basic/cryptonote_format_utils_basic.cpp
${MONERO_SRC}/crypto/crypto.cpp
${MONERO_SRC}/crypto/hash.c
${MONERO_SRC}/crypto/slow-hash-dummied.cpp
${MONERO_SRC}/crypto/oaes_lib.c
${MONERO_SRC}/crypto/crypto-ops.c
${MONERO_SRC}/crypto/crypto-ops-data.c
${MONERO_SRC}/crypto/keccak.c
${MONERO_SRC}/crypto/chacha.c
${MONERO_SRC}/crypto/random.c
${MONERO_SRC}/crypto/aesb.c
${MONERO_SRC}/crypto/tree-hash.c
${MONERO_SRC}/crypto/hash-extra-blake.c
${MONERO_SRC}/crypto/blake256.c
${MONERO_SRC}/crypto/hash-extra-groestl.c
${MONERO_SRC}/crypto/hash-extra-jh.c
${MONERO_SRC}/crypto/hash-extra-skein.c
${MONERO_SRC}/crypto/groestl.c
${MONERO_SRC}/crypto/jh.c
${MONERO_SRC}/crypto/skein.c
${MONERO_SRC}/cryptonote_core/cryptonote_tx_utils.cpp
${MONERO_SRC}/common/base58.cpp
${MONERO_SRC}/common/threadpool.cpp
${MONERO_SRC}/common/aligned.c
${MONERO_SRC}/common/util.cpp
${MONERO_SRC}/epee/src/hex.cpp
${MONERO_SRC}/epee/src/string_tools.cpp
${MONERO_SRC}/epee/src/memwipe.c
${MONERO_SRC}/epee/src/mlocker.cpp
${MONERO_SRC}/epee/src/wipeable_string.cpp
${MONERO_SRC}/device/device.cpp
${MONERO_SRC}/device/device_default.cpp
${MONERO_SRC}/ringct/rctOps.cpp
${MONERO_SRC}/ringct/rctTypes.cpp
${MONERO_SRC}/ringct/rctCryptoOps.c
${MONERO_SRC}/ringct/rctSigs.cpp
${MONERO_SRC}/ringct/bulletproofs.cc
${MONERO_SRC}/ringct/bulletproofs_plus.cc
${MONERO_SRC}/ringct/bulletproofs_plus.h
${MONERO_SRC}/ringct/multiexp.cc
${MONERO_SRC}/mnemonics/electrum-words.cpp
${MONERO_SRC}/vtlogger/logger.cpp
${MONERO_SRC}/contrib/libsodium/src/crypto_verify/verify.c
)
#
#
set (
EMCC_LINKER_FLAGS__WASM
"-Wall \
-gsource-map \
-std=c++11 \
-flto \
--bind \
-s STRICT=0 \
-s MODULARIZE=1 \
-s 'EXPORT_NAME=\"MyMoneroLibAppCpp\"' \
-s WASM=1 \
-s ASSERTIONS=2 \
-s DEMANGLE_SUPPORT=1 \
-s ALLOW_MEMORY_GROWTH=1 \
-s NO_DISABLE_EXCEPTION_CATCHING \
-s NODEJS_CATCH_EXIT=1 \
-s NODEJS_CATCH_REJECTION=0 \
-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
-s LLD_REPORT_UNDEFINED \
-s RESERVED_FUNCTION_POINTERS=5 \
-O3 \
-s EXPORTED_RUNTIME_METHODS='[\"UTF8ToString\",\"stringToUTF8\",\"lengthBytesUTF8\",\"intArrayToString\",\"getTempRet0\",\"addFunction\"]' \
--source-map-base ${CMAKE_CURRENT_LIST_DIR}/sourcemap \
--memory-init-file 1 \
--post-js ${CMAKE_CURRENT_LIST_DIR}/src/module-post.js \
")
message(STATUS "EMCC_LINKER_FLAGS__WASM ${EMCC_LINKER_FLAGS__WASM}")
#
add_executable(MyMoneroLibAppCpp_WASM ${SRC_FILES})
#
set_target_properties(MyMoneroLibAppCpp_WASM PROPERTIES COMPILE_FLAGS "-s USE_BOOST_HEADERS=1" LINK_FLAGS "${EMCC_LINKER_FLAGS__WASM}")