forked from breadwallet/breadwallet-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
383 lines (357 loc) · 19.2 KB
/
Copy pathCMakeLists.txt
File metadata and controls
383 lines (357 loc) · 19.2 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
# For more information about using CMake with Android Studio, read the
# documentation: https://d.android.com/studio/projects/add-native-code.html
# Sets the minimum version of CMake required to build the native library.
cmake_minimum_required(VERSION 3.4.1)
# now build app's shared lib
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DANDROID_STL=gnustl_static -DANDROID_TOOLCHAIN=clang")
# -Wimplicit-function-declaration
# -Wno-missing-prototypes -Werror=return-type -Wdocumentation -Wunreachable-code-aggressive -Wno-missing-braces
# -Wparentheses -Wswitch -Wno-unused-function -Wunused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body
# -Wconditional-uninitialized -Wno-unknown-pragmas -pedantic -Wshadow -Wfour-char-constants -Wno-conversion -Wconstant-conversion
# -Wint-conversion -Wbool-conversion -Wenum-conversion -Wassign-enum -Wno-shorten-64-to-32 -Wpointer-sign -Wnewline-eof
# -Wdeprecated-declarations -Wno-sign-conversion
#
# sqlite3 build
#
add_library(sqlite3
STATIC)
target_sources (sqlite3
PRIVATE
src/main/cpp/core/vendor/sqlite3/sqlite3.c
src/main/cpp/core/vendor/sqlite3/sqlite3.h)
target_include_directories(sqlite3
INTERFACE
${PROJECT_SOURCE_DIR}/src/main/cpp/core/vendor/sqlite3)
target_compile_definitions (sqlite3
PRIVATE
_HAVE_SQLITE_CONFIG_H=1)
#
# crypto build
#
add_library( # Sets the name of the library.
crypto
# Sets the library as a shared library.
SHARED)
# Support
target_sources (crypto
PRIVATE
src/main/cpp/core/support/BRAddress.c
src/main/cpp/core/support/BRAddress.h
src/main/cpp/core/support/BRAssert.c
src/main/cpp/core/support/BRAssert.h
src/main/cpp/core/support/BRArray.h
src/main/cpp/core/support/BRBase.h
src/main/cpp/core/support/BRBIP32Sequence.c
src/main/cpp/core/support/BRBIP32Sequence.h
src/main/cpp/core/support/BRBIP39Mnemonic.c
src/main/cpp/core/support/BRBIP39Mnemonic.h
src/main/cpp/core/support/BRBIP39WordsEn.h
src/main/cpp/core/support/BRBase58.c
src/main/cpp/core/support/BRBase58.h
src/main/cpp/core/support/BRBech32.c
src/main/cpp/core/support/BRBech32.h
src/main/cpp/core/support/BRCrypto.c
src/main/cpp/core/support/BRCrypto.h
src/main/cpp/core/support/BRFileService.c
src/main/cpp/core/support/BRFileService.h
src/main/cpp/core/support/BRInt.h
src/main/cpp/core/support/BRKey.c
src/main/cpp/core/support/BRKey.h
src/main/cpp/core/support/BRKeyECIES.c
src/main/cpp/core/support/BRKeyECIES.h
src/main/cpp/core/support/BRSet.c
src/main/cpp/core/support/BRSet.h
src/main/cpp/core/support/BRSyncMode.c
src/main/cpp/core/support/BRSyncMode.h)
# Support Tests
if (CMAKE_BUILD_TYPE MATCHES Debug)
target_sources (crypto
PRIVATE
src/main/cpp/core/support/testSup.c)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
# Bitcoin
target_sources (crypto
PRIVATE
src/main/cpp/core/bitcoin/BRBIP38Key.c
src/main/cpp/core/bitcoin/BRBIP38Key.h
src/main/cpp/core/bitcoin/BRBloomFilter.c
src/main/cpp/core/bitcoin/BRBloomFilter.h
src/main/cpp/core/bitcoin/BRChainParams.h
src/main/cpp/core/bitcoin/BRChainParams.c
src/main/cpp/core/bitcoin/BRMerkleBlock.c
src/main/cpp/core/bitcoin/BRMerkleBlock.h
src/main/cpp/core/bitcoin/BRPaymentProtocol.c
src/main/cpp/core/bitcoin/BRPaymentProtocol.h
src/main/cpp/core/bitcoin/BRPeer.c
src/main/cpp/core/bitcoin/BRPeer.h
src/main/cpp/core/bitcoin/BRPeerManager.c
src/main/cpp/core/bitcoin/BRPeerManager.h
src/main/cpp/core/bitcoin/BRSyncManager.c
src/main/cpp/core/bitcoin/BRSyncManager.h
src/main/cpp/core/bitcoin/BRTransaction.c
src/main/cpp/core/bitcoin/BRTransaction.h
src/main/cpp/core/bitcoin/BRWallet.c
src/main/cpp/core/bitcoin/BRWallet.h
src/main/cpp/core/bitcoin/BRWalletManager.c
src/main/cpp/core/bitcoin/BRWalletManager.h
src/main/cpp/core/bitcoin/BRWalletManagerEvent.c
src/main/cpp/core/bitcoin/BRWalletManagerPrivate.h)
# Bitcoin Tests
if (CMAKE_BUILD_TYPE MATCHES Debug)
target_sources (crypto
PRIVATE
src/main/cpp/core/bitcoin/test.c
src/main/cpp/core/bitcoin/testBwm.c)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
# BCash
target_sources (crypto
PRIVATE
src/main/cpp/core/bcash/BRBCashAddr.c
src/main/cpp/core/bcash/BRBCashAddr.h
src/main/cpp/core/bcash/BRBCashParams.h
src/main/cpp/core/bcash/BRBCashParams.c)
# Ethereum
target_sources (crypto
PRIVATE
src/main/cpp/core/ethereum/BREthereum.h
# Util
src/main/cpp/core/ethereum/util/BRKeccak.c
src/main/cpp/core/ethereum/util/BRKeccak.h
src/main/cpp/core/ethereum/util/BRUtil.h
src/main/cpp/core/ethereum/util/BRUtilHex.c
src/main/cpp/core/ethereum/util/BRUtilHex.h
src/main/cpp/core/ethereum/util/BRUtilMath.c
src/main/cpp/core/ethereum/util/BRUtilMath.h
src/main/cpp/core/ethereum/util/BRUtilMathParse.c
# RLP
src/main/cpp/core/ethereum/rlp/BRRlp.h
src/main/cpp/core/ethereum/rlp/BRRlpCoder.c
src/main/cpp/core/ethereum/rlp/BRRlpCoder.h
# Event
src/main/cpp/core/ethereum/event/BREvent.c
src/main/cpp/core/ethereum/event/BREvent.h
src/main/cpp/core/ethereum/event/BREventAlarm.c
src/main/cpp/core/ethereum/event/BREventAlarm.h
src/main/cpp/core/ethereum/event/BREventQueue.c
src/main/cpp/core/ethereum/event/BREventQueue.h
# Base
src/main/cpp/core/ethereum/base/BREthereumAddress.c
src/main/cpp/core/ethereum/base/BREthereumAddress.h
src/main/cpp/core/ethereum/base/BREthereumBase.h
src/main/cpp/core/ethereum/base/BREthereumEther.c
src/main/cpp/core/ethereum/base/BREthereumEther.h
src/main/cpp/core/ethereum/base/BREthereumGas.c
src/main/cpp/core/ethereum/base/BREthereumGas.h
src/main/cpp/core/ethereum/base/BREthereumFeeBasis.c
src/main/cpp/core/ethereum/base/BREthereumFeeBasis.h
src/main/cpp/core/ethereum/base/BREthereumHash.c
src/main/cpp/core/ethereum/base/BREthereumHash.h
src/main/cpp/core/ethereum/base/BREthereumData.c
src/main/cpp/core/ethereum/base/BREthereumData.h
src/main/cpp/core/ethereum/base/BREthereumLogic.h
src/main/cpp/core/ethereum/base/BREthereumSignature.c
src/main/cpp/core/ethereum/base/BREthereumSignature.h
# Block Chain
src/main/cpp/core/ethereum/blockchain/BREthereumAccountState.c
src/main/cpp/core/ethereum/blockchain/BREthereumAccountState.h
src/main/cpp/core/ethereum/blockchain/BREthereumBlock.c
src/main/cpp/core/ethereum/blockchain/BREthereumBlock.h
src/main/cpp/core/ethereum/blockchain/BREthereumBlockChain.h
src/main/cpp/core/ethereum/blockchain/BREthereumBloomFilter.c
src/main/cpp/core/ethereum/blockchain/BREthereumBloomFilter.h
src/main/cpp/core/ethereum/blockchain/BREthereumLog.c
src/main/cpp/core/ethereum/blockchain/BREthereumLog.h
src/main/cpp/core/ethereum/blockchain/BREthereumNetwork.c
src/main/cpp/core/ethereum/blockchain/BREthereumNetwork.h
src/main/cpp/core/ethereum/blockchain/BREthereumTransaction.c
src/main/cpp/core/ethereum/blockchain/BREthereumTransaction.h
src/main/cpp/core/ethereum/blockchain/BREthereumTransactionReceipt.c
src/main/cpp/core/ethereum/blockchain/BREthereumTransactionReceipt.h
src/main/cpp/core/ethereum/blockchain/BREthereumTransactionStatus.c
src/main/cpp/core/ethereum/blockchain/BREthereumTransactionStatus.h
src/main/cpp/core/ethereum/blockchain/BREthereumProofOfWork.c
# Contract
src/main/cpp/core/ethereum/contract/BREthereumContract.c
src/main/cpp/core/ethereum/contract/BREthereumContract.h
src/main/cpp/core/ethereum/contract/BREthereumToken.c
src/main/cpp/core/ethereum/contract/BREthereumToken.h
# MPT
src/main/cpp/core/ethereum/mpt/BREthereumMPT.c
src/main/cpp/core/ethereum/mpt/BREthereumMPT.h
# LES Msg
src/main/cpp/core/ethereum/les/msg/BREthereumMessageDIS.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessageDIS.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageETH.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageLES.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessageLES.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageP2P.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessageP2P.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessagePIP.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessagePIP.h
# LES
src/main/cpp/core/ethereum/les/BREthereumLES.c
src/main/cpp/core/ethereum/les/BREthereumLES.h
src/main/cpp/core/ethereum/les/BREthereumLESBase.h
src/main/cpp/core/ethereum/les/BREthereumLESFrameCoder.c
src/main/cpp/core/ethereum/les/BREthereumLESFrameCoder.h
src/main/cpp/core/ethereum/les/BREthereumLESRandom.c
src/main/cpp/core/ethereum/les/BREthereumLESRandom.h
src/main/cpp/core/ethereum/les/BREthereumMessage.c
src/main/cpp/core/ethereum/les/BREthereumMessage.h
src/main/cpp/core/ethereum/les/BREthereumNode.c
src/main/cpp/core/ethereum/les/BREthereumNode.h
src/main/cpp/core/ethereum/les/BREthereumNodeEndpoint.c
src/main/cpp/core/ethereum/les/BREthereumNodeEndpoint.h
src/main/cpp/core/ethereum/les/BREthereumProvision.c
src/main/cpp/core/ethereum/les/BREthereumProvision.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageP2P.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageP2P.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessageDIS.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageDIS.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessageETH.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageLES.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessageLES.c
src/main/cpp/core/ethereum/les/msg/BREthereumMessagePIP.h
src/main/cpp/core/ethereum/les/msg/BREthereumMessagePIP.c
# BCS
src/main/cpp/core/ethereum/bcs/BREthereumBCS.c
src/main/cpp/core/ethereum/bcs/BREthereumBCS.h
src/main/cpp/core/ethereum/bcs/BREthereumBCSEvent.c
src/main/cpp/core/ethereum/bcs/BREthereumBCSPrivate.h
src/main/cpp/core/ethereum/bcs/BREthereumBCSSync.c
src/main/cpp/core/ethereum/bcs/BREthereumBlockChainSlice.h
#EWM
src/main/cpp/core/ethereum/ewm/BREthereumBase.h
src/main/cpp/core/ethereum/ewm/BREthereumAccount.c
src/main/cpp/core/ethereum/ewm/BREthereumAccount.h
src/main/cpp/core/ethereum/ewm/BREthereumAmount.c
src/main/cpp/core/ethereum/ewm/BREthereumAmount.h
src/main/cpp/core/ethereum/ewm/BREthereumTransfer.c
src/main/cpp/core/ethereum/ewm/BREthereumTransfer.h
src/main/cpp/core/ethereum/ewm/BREthereumWallet.c
src/main/cpp/core/ethereum/ewm/BREthereumWallet.h
src/main/cpp/core/ethereum/ewm/BREthereumClient.h
src/main/cpp/core/ethereum/ewm/BREthereumEWM.c
src/main/cpp/core/ethereum/ewm/BREthereumEWM.h
src/main/cpp/core/ethereum/ewm/BREthereumEWMClient.c
src/main/cpp/core/ethereum/ewm/BREthereumEWMEvent.c
src/main/cpp/core/ethereum/ewm/BREthereumEWMPersist.c
src/main/cpp/core/ethereum/ewm/BREthereumEWMPrivate.h)
# Ethereum Tests
if (CMAKE_BUILD_TYPE MATCHES Debug)
target_sources (crypto
PRIVATE
src/main/cpp/core/ethereum/base/testBase.c
src/main/cpp/core/ethereum/blockchain/testBc.c
src/main/cpp/core/ethereum/contract/testContract.c
src/main/cpp/core/ethereum/event/testEvent.c
src/main/cpp/core/ethereum/ewm/testEwm.c
src/main/cpp/core/ethereum/rlp/testRlp.c
src/main/cpp/core/ethereum/les/testLES.c
src/main/cpp/core/ethereum/util/testUtil.c
src/main/cpp/core/ethereum/test.c)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
# Ripple
target_sources (crypto
PRIVATE
src/main/cpp/core/ripple/BRRipplePrivateStructs.h
src/main/cpp/core/ripple/BRRippleBase.h
src/main/cpp/core/ripple/BRRipple.h
src/main/cpp/core/ripple/BRRippleAccount.c
src/main/cpp/core/ripple/BRRippleAccount.h
src/main/cpp/core/ripple/BRRippleBase58.c
src/main/cpp/core/ripple/BRRippleBase58.h
src/main/cpp/core/ripple/BRRippleSerialize.c
src/main/cpp/core/ripple/BRRippleSerialize.h
src/main/cpp/core/ripple/BRRippleSignature.c
src/main/cpp/core/ripple/BRRippleSignature.h
src/main/cpp/core/ripple/BRRippleTransaction.c
src/main/cpp/core/ripple/BRRippleTransaction.h
src/main/cpp/core/ripple/BRRippleWallet.c
src/main/cpp/core/ripple/BRRippleWallet.h)
# Ripple Tests
if (CMAKE_BUILD_TYPE MATCHES Debug)
target_sources (crypto
PRIVATE
src/main/cpp/core/ripple/testRipple.c
src/main/cpp/core/ripple/testRippleTxList1.h
src/main/cpp/core/ripple/testRippleTxList2.h)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
# Generic
target_sources (crypto
PRIVATE
src/main/cpp/core/generic/BRGenericBase.h
src/main/cpp/core/generic/BRGeneric.c
src/main/cpp/core/generic/BRGeneric.h
src/main/cpp/core/generic/BRGenericHandlers.c
src/main/cpp/core/generic/BRGenericHandlers.h
src/main/cpp/core/generic/BRGenericWalletManager.c
src/main/cpp/core/generic/BRGenericWalletManager.h
src/main/cpp/core/generic/BRGenericRipple.h
src/main/cpp/core/generic/BRGenericRipple.c)
# Crypto
target_sources (crypto
PRIVATE
src/main/cpp/core/crypto/BRCryptoAccount.c
src/main/cpp/core/crypto/BRCryptoAccount.h
src/main/cpp/core/crypto/BRCryptoAddress.c
src/main/cpp/core/crypto/BRCryptoAddress.h
src/main/cpp/core/crypto/BRCryptoAmount.c
src/main/cpp/core/crypto/BRCryptoAmount.h
src/main/cpp/core/crypto/BRCryptoBase.h
src/main/cpp/core/crypto/BRCryptoCurrency.c
src/main/cpp/core/crypto/BRCryptoCurrency.h
src/main/cpp/core/crypto/BRCryptoFeeBasis.c
src/main/cpp/core/crypto/BRCryptoFeeBasis.h
src/main/cpp/core/crypto/BRCryptoHash.c
src/main/cpp/core/crypto/BRCryptoHash.h
src/main/cpp/core/crypto/BRCryptoCipher.c
src/main/cpp/core/crypto/BRCryptoCipher.h
src/main/cpp/core/crypto/BRCryptoCoder.c
src/main/cpp/core/crypto/BRCryptoCoder.h
src/main/cpp/core/crypto/BRCryptoHasher.c
src/main/cpp/core/crypto/BRCryptoHasher.h
src/main/cpp/core/crypto/BRCryptoKey.c
src/main/cpp/core/crypto/BRCryptoKey.h
src/main/cpp/core/crypto/BRCryptoSigner.c
src/main/cpp/core/crypto/BRCryptoSigner.h
src/main/cpp/core/crypto/BRCryptoNetwork.c
src/main/cpp/core/crypto/BRCryptoNetwork.h
src/main/cpp/core/crypto/BRCryptoStatus.c
src/main/cpp/core/crypto/BRCryptoStatus.h
src/main/cpp/core/crypto/BRCryptoPayment.c
src/main/cpp/core/crypto/BRCryptoPayment.h
src/main/cpp/core/crypto/BRCryptoPeer.c
src/main/cpp/core/crypto/BRCryptoPeer.h
src/main/cpp/core/crypto/BRCryptoPrivate.h
src/main/cpp/core/crypto/BRCryptoTransfer.c
src/main/cpp/core/crypto/BRCryptoTransfer.h
src/main/cpp/core/crypto/BRCryptoUnit.c
src/main/cpp/core/crypto/BRCryptoUnit.h
src/main/cpp/core/crypto/BRCryptoWallet.c
src/main/cpp/core/crypto/BRCryptoWallet.h
src/main/cpp/core/crypto/BRCryptoWalletManager.c
src/main/cpp/core/crypto/BRCryptoWalletManager.h
src/main/cpp/core/crypto/BRCryptoWalletManagerClient.c
src/main/cpp/core/crypto/BRCryptoWalletManagerClient.h
src/main/cpp/core/crypto/BRCryptoWalletManagerPrivate.h)
# Crypto Tests
if (CMAKE_BUILD_TYPE MATCHES Debug)
target_sources (crypto
PRIVATE
src/main/cpp/core/crypto/testCrypto.c)
endif(CMAKE_BUILD_TYPE MATCHES Debug)
target_include_directories (crypto
PUBLIC
${PROJECT_SOURCE_DIR}/src/main/cpp/core
${PROJECT_SOURCE_DIR}/src/main/cpp/core/support
${PROJECT_SOURCE_DIR}/src/main/cpp/core/bitcoin
${PROJECT_SOURCE_DIR}/src/main/cpp/core/bcash
${PROJECT_SOURCE_DIR}/src/main/cpp/core/ethereum
${PROJECT_SOURCE_DIR}/src/main/cpp/core/vendor/secp256k1
${PROJECT_SOURCE_DIR}/src/main/cpp/core/crypto)
find_library (log-lib
log)
target_link_libraries (crypto
${log-lib}
sqlite3)