forked from monero-project/monero-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
monero-wallet-gui.pro
473 lines (404 loc) · 12.8 KB
/
monero-wallet-gui.pro
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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
# qml components require at least QT 5.7.0
lessThan (QT_MAJOR_VERSION, 5) | lessThan (QT_MINOR_VERSION, 7) {
error("Can't build with Qt $${QT_VERSION}. Use at least Qt 5.7.0")
}
TEMPLATE = app
QT += qml quick widgets
WALLET_ROOT=$$PWD/monero
CONFIG += c++11 link_pkgconfig
packagesExist(hidapi-libusb) {
PKGCONFIG += hidapi-libusb
}
!win32 {
QMAKE_CXXFLAGS += -fPIC -fstack-protector -fstack-protector-strong
QMAKE_LFLAGS += -fstack-protector -fstack-protector-strong
}
# cleaning "auto-generated" bitmonero directory on "make distclean"
QMAKE_DISTCLEAN += -r $$WALLET_ROOT
INCLUDEPATH += $$WALLET_ROOT/include \
$$PWD/src/libwalletqt \
$$PWD/src/QR-Code-generator \
$$PWD/src \
$$WALLET_ROOT/src
HEADERS += \
filter.h \
clipboardAdapter.h \
oscursor.h \
src/libwalletqt/WalletManager.h \
src/libwalletqt/Wallet.h \
src/libwalletqt/PendingTransaction.h \
src/libwalletqt/TransactionHistory.h \
src/libwalletqt/TransactionInfo.h \
src/libwalletqt/QRCodeImageProvider.h \
src/libwalletqt/Transfer.h \
src/NetworkType.h \
oshelper.h \
TranslationManager.h \
src/model/TransactionHistoryModel.h \
src/model/TransactionHistorySortFilterModel.h \
src/QR-Code-generator/BitBuffer.hpp \
src/QR-Code-generator/QrCode.hpp \
src/QR-Code-generator/QrSegment.hpp \
src/model/AddressBookModel.h \
src/libwalletqt/AddressBook.h \
src/model/SubaddressModel.h \
src/libwalletqt/Subaddress.h \
src/model/SubaddressAccountModel.h \
src/libwalletqt/SubaddressAccount.h \
src/zxcvbn-c/zxcvbn.h \
src/libwalletqt/UnsignedTransaction.h \
Logger.h \
MainApp.h
SOURCES += main.cpp \
filter.cpp \
clipboardAdapter.cpp \
oscursor.cpp \
src/libwalletqt/WalletManager.cpp \
src/libwalletqt/Wallet.cpp \
src/libwalletqt/PendingTransaction.cpp \
src/libwalletqt/TransactionHistory.cpp \
src/libwalletqt/TransactionInfo.cpp \
src/libwalletqt/QRCodeImageProvider.cpp \
oshelper.cpp \
TranslationManager.cpp \
src/model/TransactionHistoryModel.cpp \
src/model/TransactionHistorySortFilterModel.cpp \
src/QR-Code-generator/BitBuffer.cpp \
src/QR-Code-generator/QrCode.cpp \
src/QR-Code-generator/QrSegment.cpp \
src/model/AddressBookModel.cpp \
src/libwalletqt/AddressBook.cpp \
src/model/SubaddressModel.cpp \
src/libwalletqt/Subaddress.cpp \
src/model/SubaddressAccountModel.cpp \
src/libwalletqt/SubaddressAccount.cpp \
src/zxcvbn-c/zxcvbn.c \
src/libwalletqt/UnsignedTransaction.cpp \
Logger.cpp \
MainApp.cpp
CONFIG(DISABLE_PASS_STRENGTH_METER) {
HEADERS -= src/zxcvbn-c/zxcvbn.h
SOURCES -= src/zxcvbn-c/zxcvbn.c
DEFINES += "DISABLE_PASS_STRENGTH_METER"
}
!ios {
HEADERS += src/daemon/DaemonManager.h
SOURCES += src/daemon/DaemonManager.cpp
}
lupdate_only {
SOURCES = *.qml \
components/*.qml \
pages/*.qml \
pages/settings/*.qml \
pages/merchant/*.qml \
wizard/*.qml \
wizard/*js
}
# Linker flags required by Trezor
TREZOR_LINKER = $$cat($$WALLET_ROOT/lib/trezor_link_flags.txt)
ios:armv7 {
message("target is armv7")
LIBS += \
-L$$PWD/../ofxiOSBoost/build/libs/boost/lib/armv7 \
}
ios:arm64 {
message("target is arm64")
LIBS += \
-L$$PWD/../ofxiOSBoost/build/libs/boost/lib/arm64 \
}
!ios:!android {
LIBS += -L$$WALLET_ROOT/lib \
-lwallet_merged \
-llmdb \
-lepee \
-lunbound \
-lsodium \
-leasylogging
}
android {
message("Host is Android")
LIBS += -L$$WALLET_ROOT/lib \
-lwallet_merged \
-llmdb \
-lepee \
-lunbound \
-lsodium \
-leasylogging
}
QMAKE_CXXFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wformat -Wformat-security
QMAKE_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wformat -Wformat-security
ios {
message("Host is IOS")
QMAKE_LFLAGS += -v
QMAKE_IOS_DEVICE_ARCHS = arm64
CONFIG += arm64
LIBS += -L$$WALLET_ROOT/lib-ios \
-lwallet_merged \
-llmdb \
-lepee \
-lunbound \
-lsodium \
-leasylogging
LIBS+= \
-L$$PWD/../OpenSSL-for-iPhone/lib \
-L$$PWD/../ofxiOSBoost/build/libs/boost/lib/arm64 \
-lboost_serialization \
-lboost_thread \
-lboost_system \
-lboost_date_time \
-lboost_filesystem \
-lboost_regex \
-lboost_chrono \
-lboost_program_options \
-lssl \
-lcrypto \
-ldl
}
CONFIG(WITH_SCANNER) {
if( greaterThan(QT_MINOR_VERSION, 5) ) {
message("using camera scanner")
QT += multimedia
DEFINES += "WITH_SCANNER"
INCLUDEPATH += $$PWD/src/QR-Code-scanner
HEADERS += \
src/QR-Code-scanner/QrScanThread.h \
src/QR-Code-scanner/QrCodeScanner.h
SOURCES += \
src/QR-Code-scanner/QrScanThread.cpp \
src/QR-Code-scanner/QrCodeScanner.cpp
android {
INCLUDEPATH += $$PWD/../ZBar/include
LIBS += -lzbarjni -liconv
} else {
LIBS += -lzbar
}
} else {
message("Skipping camera scanner because of Incompatible Qt Version !")
}
}
# currently we only support x86 build as qt.io only provides prebuilt qt for x86 mingw
win32 {
# QMAKE_HOST.arch is unreliable, will allways report 32bit if mingw32 shell is run.
# Obtaining arch through uname should be reliable. This also fixes building the project in Qt creator without changes.
MSYS_HOST_ARCH = $$system(uname -a | grep -o "x86_64")
# WIN64 Host settings
contains(MSYS_HOST_ARCH, x86_64) {
message("Host is 64bit")
MSYS_ROOT_PATH=c:/msys64
# WIN32 Host settings
} else {
message("Host is 32bit")
MSYS_ROOT_PATH=c:/msys32
}
# WIN64 Target settings
contains(QMAKE_HOST.arch, x86_64) {
MSYS_MINGW_PATH=/mingw64
# WIN32 Target settings
} else {
MSYS_MINGW_PATH=/mingw32
}
MSYS_PATH=$$MSYS_ROOT_PATH$$MSYS_MINGW_PATH
# boost root path
BOOST_PATH=$$MSYS_PATH/boost
BOOST_MINGW_PATH=$$MSYS_MINGW_PATH/boost
LIBS+=-L$$MSYS_PATH/lib
LIBS+=-L$$MSYS_MINGW_PATH/lib
LIBS+=-L$$BOOST_PATH/lib
LIBS+=-L$$BOOST_MINGW_PATH/lib
LIBS+= \
-Wl,-Bstatic \
-lboost_serialization-mt \
-lboost_thread-mt \
-lboost_system-mt \
-lboost_date_time-mt \
-lboost_filesystem-mt \
-lboost_regex-mt \
-lboost_chrono-mt \
-lboost_program_options-mt \
-lboost_locale-mt \
-licuio \
-licuin \
-licuuc \
-licudt \
-licutu \
-liconv \
-lssl \
-lsodium \
-lcrypto \
-Wl,-Bdynamic \
-lwinscard \
-lws2_32 \
-lwsock32 \
-lIphlpapi \
-lcrypt32 \
-lhidapi \
-lgdi32 $$TREZOR_LINKER
!contains(QMAKE_TARGET.arch, x86_64) {
message("Target is 32bit")
## Windows x86 (32bit) specific build here
## there's 2Mb stack in libwallet allocated internally, so we set stack=4Mb
## this fixes app crash for x86 Windows build
QMAKE_LFLAGS += -Wl,--stack,4194304
} else {
message("Target is 64bit")
}
QMAKE_LFLAGS += -Wl,--dynamicbase -Wl,--nxcompat
}
linux {
CONFIG(static) {
message("using static libraries")
LIBS+= -Wl,-Bstatic
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
# contains(QT_ARCH, x86_64) {
LIBS+= -lunbound \
-lusb-1.0 \
-lhidapi-hidraw \
-ludev
# }
} else {
# On some distro's we need to add dynload
LIBS+= -ldl
}
LIBS+= \
-lboost_serialization \
-lboost_thread \
-lboost_system \
-lboost_date_time \
-lboost_filesystem \
-lboost_regex \
-lboost_chrono \
-lboost_program_options \
-lssl \
-llmdb \
-lsodium \
-lhidapi-libusb \
-lcrypto $$TREZOR_LINKER
if(!android) {
LIBS+= \
-Wl,-Bdynamic \
-lGL
}
# currently monero has an issue with "static" build and linunwind-dev,
# so we link libunwind-dev only for non-Ubuntu distros
CONFIG(libunwind_off) {
message(Building without libunwind)
} else {
message(Building with libunwind)
LIBS += -Wl,-Bdynamic -lunwind
}
QMAKE_LFLAGS += -pie -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack
}
macx {
# mixing static and shared libs are not supported on mac
# CONFIG(static) {
# message("using static libraries")
# LIBS+= -Wl,-Bstatic
# }
LIBS+= \
-L/usr/local/lib \
-L/usr/local/opt/openssl/lib \
-L/usr/local/opt/boost/lib \
-lboost_serialization \
-lhidapi \
-lboost_thread-mt \
-lboost_system \
-lboost_date_time \
-lboost_filesystem \
-lboost_regex \
-lboost_chrono \
-lboost_program_options \
-lssl \
-lsodium \
-lcrypto \
-ldl $$TREZOR_LINKER
QMAKE_LFLAGS += -pie
}
# translation stuff
TRANSLATIONS = $$files($$PWD/translations/monero-core_*.ts)
CONFIG(release, debug|release) {
DESTDIR = release/bin
LANGUPD_OPTIONS = -locations relative -no-ui-lines
LANGREL_OPTIONS = -compress -nounfinished -removeidentical
} else {
DESTDIR = debug/bin
LANGUPD_OPTIONS =
# LANGREL_OPTIONS = -markuntranslated "MISS_TR "
}
TRANSLATION_TARGET_DIR = $$OUT_PWD/translations
!ios {
isEmpty(QMAKE_LUPDATE) {
win32:LANGUPD = $$[QT_INSTALL_BINS]\lupdate.exe
else:LANGUPD = $$[QT_INSTALL_BINS]/lupdate
}
isEmpty(QMAKE_LRELEASE) {
win32:LANGREL = $$[QT_INSTALL_BINS]\lrelease.exe
else:LANGREL = $$[QT_INSTALL_BINS]/lrelease
}
langupd.command = \
$$LANGUPD $$LANGUPD_OPTIONS $$shell_path($$_PRO_FILE) -ts $$_PRO_FILE_PWD/$$TRANSLATIONS
langrel.depends = langupd
langrel.input = TRANSLATIONS
langrel.output = $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
langrel.commands = \
$$LANGREL $$LANGREL_OPTIONS ${QMAKE_FILE_IN} -qm $$TRANSLATION_TARGET_DIR/${QMAKE_FILE_BASE}.qm
langrel.CONFIG += no_link
QMAKE_EXTRA_TARGETS += langupd deploy deploy_win
QMAKE_EXTRA_COMPILERS += langrel
# Compile an initial version of translation files when running qmake
# the first time and generate the resource file for translations.
!exists($$TRANSLATION_TARGET_DIR) {
mkpath($$TRANSLATION_TARGET_DIR)
}
qrc_entry = "<RCC>"
qrc_entry += ' <qresource prefix="/">'
write_file($$TRANSLATION_TARGET_DIR/translations.qrc, qrc_entry)
for(tsfile, TRANSLATIONS) {
qmfile = $$TRANSLATION_TARGET_DIR/$$basename(tsfile)
qmfile ~= s/.ts$/.qm/
system($$LANGREL $$LANGREL_OPTIONS $$tsfile -qm $$qmfile)
qrc_entry = " <file>$$basename(qmfile)</file>"
write_file($$TRANSLATION_TARGET_DIR/translations.qrc, qrc_entry, append)
}
qrc_entry = " </qresource>"
qrc_entry += "</RCC>"
write_file($$TRANSLATION_TARGET_DIR/translations.qrc, qrc_entry, append)
RESOURCES += $$TRANSLATION_TARGET_DIR/translations.qrc
}
# Update: no issues with the "slow link process" anymore,
# for development, just build debug version of libwallet_merged lib
# by invoking 'get_libwallet_api.sh Debug'
# so we update translations everytime even for debug build
PRE_TARGETDEPS += langupd compiler_langrel_make_all
RESOURCES += qml.qrc
CONFIG += qtquickcompiler
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = fonts
# Default rules for deployment.
include(deployment.pri)
macx {
deploy.commands += macdeployqt $$sprintf("%1/%2/%3.app", $$OUT_PWD, $$DESTDIR, $$TARGET) -qmldir=$$PWD
}
win32 {
deploy.commands += windeployqt $$sprintf("%1/%2/%3.exe", $$OUT_PWD, $$DESTDIR, $$TARGET) -release -no-translations -qmldir=$$PWD
# Win64 msys2 deploy settings
contains(QMAKE_HOST.arch, x86_64) {
deploy.commands += $$escape_expand(\n\t) $$PWD/windeploy_helper.sh $$DESTDIR
}
}
linux:!android {
deploy.commands += $$escape_expand(\n\t) $$PWD/linuxdeploy_helper.sh $$DESTDIR $$TARGET
}
android{
deploy.commands += make install INSTALL_ROOT=$$DESTDIR && androiddeployqt --input android-libmonero-wallet-gui.so-deployment-settings.json --output $$DESTDIR --deployment bundled --android-platform android-21 --jdk /usr/lib/jvm/java-8-openjdk-amd64 -qmldir=$$PWD
}
OTHER_FILES += \
.gitignore \
$$TRANSLATIONS
DISTFILES += \
notes.txt \
monero/src/wallet/CMakeLists.txt
# windows application icon
RC_ICONS = images/appicon.ico
# mac Info.plist & application icon
QMAKE_INFO_PLIST = $$PWD/share/Info.plist
ICON = $$PWD/images/appicon.icns