-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathUnoSemuxLightCoreWasm.pro
154 lines (136 loc) · 4.66 KB
/
UnoSemuxLightCoreWasm.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
CONFIG -= qt
QT -= core gui widgets
TEMPLATE = app
VER_MAJ = 0
VER_MIN = 1
VER_PAT = 1
CONFIG += warn_on
DEFINES += UNOSEMUXLIGHTCOREWASM_LIBRARY \
HAVE_NETINET_IN_H \
_GLIBCXX_USE_NANOSLEEP
PACKET_NAME = UnoSemuxLightCoreWasm
OUT_BUILD_PATH = ./../../../Bin_tmp/
compiler_gcc{
QMAKE_CC = gcc-10
QMAKE_CXX = g++-10
QMAKE_LINK = g++-10
}else:compiler_clang{
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
#QMAKE_CXXFLAGS += -stdlib=libstdc++
#QMAKE_LFLAGS += -stdlib=libstdc++
}else:compiler_emscripten{
}else{
error(Unknown compiler mode. Set CONFIG+=compiler_gcc OR CONFIG+=compiler_clang OR CONFIG+=compiler_emscripten)
}
#c++20
CONFIG += c++20
QMAKE_CXXFLAGS += -std=gnu++20
QMAKE_CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden
QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections -fexceptions -fstrict-aliasing -fstack-clash-protection
QMAKE_CXXFLAGS += -Wall -Wextra -Wno-comment -Wdouble-promotion -Wswitch-default -Wswitch-enum -Wuninitialized
QMAKE_CXXFLAGS += -Wstrict-aliasing -Wfloat-equal -Wshadow -Wplacement-new -Wcast-align -Wconversion -Wlogical-op
QMAKE_CXXFLAGS += -Wduplicated-cond -Wduplicated-branches -Wrestrict -Wnull-dereference -Wno-terminate
#QMAKE_CXXFLAGS += -fno-rtti
QMAKE_LFLAGS += -Wl,--gc-sections
#------------------------ DEBUG or RELEASE ---------------------
debug_build {
message([$$PACKET_NAME]: ***************** Build mode DEBUG *****************)
DEFINES += DEBUG_BUILD
TARGET_POSTFIX = _d
OUT_BUILD_MODE_PATH = Debug
os_linux {
QMAKE_CXXFLAGS += -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr
LIBS += -lasan
LIBS += -lubsan
#BOOST_POSTFIX = _asan
}
} else:release_build {
message([$$PACKET_NAME]: ***************** Build mode RELEASE *****************)
DEFINES += RELEASE_BUILD
TARGET_POSTFIX =
OUT_BUILD_MODE_PATH = Release
} else {
error(Unknown build mode. Set CONFIG+=debug_build OR CONFIG+=release_build)
}
#------------------------ OS ---------------------
os_linux {
OUT_BUILD_OS_PATH = Linux
} else:os_android {
OUT_BUILD_OS_PATH = Android
} else:os_ios {
OUT_BUILD_OS_PATH = Ios
} else:os_windows {
OUT_BUILD_OS_PATH = Win
} else:os_macx {
OUT_BUILD_OS_PATH = Macx
} else:os_browser {
OUT_BUILD_OS_PATH = Browser
DEFINES += __EMSCRIPTEN__
} else {
error(Unknown OS. Set CONFIG+=... one of values: os_linux, os_android, os_ios, os_windows, os_macx, os_browser)
}
#------------------------ ARC ---------------------
arc_x86_64 {
OUT_BUILD_ARCH_PATH = x86_64
QMAKE_CXXFLAGS += -mtune=generic -march=x86-64
} else:arc_x86 {
OUT_BUILD_ARCH_PATH = x86
QMAKE_CXXFLAGS += -mtune=generic -march=i686
} else:arc_arm_v6 {
OUT_BUILD_ARCH_PATH = arm_v6
} else:arc_armeabi_v7a {
OUT_BUILD_ARCH_PATH = armeabi_v7a
} else:arc_arm64_v8a {
OUT_BUILD_ARCH_PATH = arm64_v8a
} else:arc_mips {
OUT_BUILD_ARCH_PATH = mips
} else:arc_wasm32 {
OUT_BUILD_ARCH_PATH = wasm32
} else:arc_wasm64 {
OUT_BUILD_ARCH_PATH = wasm64
} else {
error(Unknown ARC. Set CONFIG+=... one of values: arc_x86_64, arc_x86, arc_arm_v6, arc_armeabi_v7a, arc_arm64_v8a, arc_mips, arc_wasm32, arc_wasm64)
}
TARGET = $$PACKET_NAME$$TARGET_POSTFIX
SP = _
DESTDIR = $$OUT_BUILD_PATH$$OUT_BUILD_MODE_PATH$$SP$$OUT_BUILD_OS_PATH$$SP$$OUT_BUILD_ARCH_PATH/
message([$$PACKET_NAME]: Target name: $$TARGET)
message([$$PACKET_NAME]: Target arch: $$OUT_BUILD_ARCH_PATH)
message([$$PACKET_NAME]: Target OS: $$OUT_BUILD_OS_PATH)
message([$$PACKET_NAME]: Build directory $$DESTDIR)
message([$$PACKET_NAME]: -------------------------------------------------)
#------------------------------ LIBS BEGIN ---------------------------------
LIBS += -L$$DESTDIR \
-L$$DESTDIR/Plugins
os_windows{
GP_CORE_LIB_V = 2
GP_CRYPTO_CORE_LIB_V = 0
UNO_SEMUX_LIGHT_CORE_V = 0
}
LIBS += -lsodium
LIBS += -lutf8proc$$TARGET_POSTFIX
LIBS += -lGpCore2$$TARGET_POSTFIX$$GP_CORE_LIB_V
LIBS += -lGpCryptoCore$$TARGET_POSTFIX$$GP_CRYPTO_CORE_LIB_V
LIBS += -lUnoSemuxLightCore$$TARGET_POSTFIX$$UNO_SEMUX_LIGHT_CORE_V
#------------------------------ LIBS END ---------------------------------
INCLUDEPATH += \
../Extras \
../Extras/Boost/boost_1_72_0$$BOOST_POSTFIX
SOURCES += \
Wallet/UnoSemuxAddrWasm.cpp \
Wallet/UnoSemuxNetworkTypeWasm.cpp \
Wallet/UnoSemuxTransactionSignWasm.cpp \
Wallet/UnoSemuxTransactionTypeWasm.cpp \
Wallet/UnoSemuxTransactionWasm.cpp \
Wallet/UnoSemuxWalletWasm.cpp \
WasmUtils/UnoSemuxWasmUtils.cpp
HEADERS += \
UnoSemuxLightCoreWasm_global.hpp \
Wallet/UnoSemuxAddrWasm.hpp \
Wallet/UnoSemuxNetworkTypeWasm.hpp \
Wallet/UnoSemuxTransactionSignWasm.hpp \
Wallet/UnoSemuxTransactionTypeWasm.hpp \
Wallet/UnoSemuxTransactionWasm.hpp \
Wallet/UnoSemuxWalletWasm.hpp \
WasmUtils/UnoSemuxWasmUtils.hpp