-
Notifications
You must be signed in to change notification settings - Fork 211
/
klayout.pri
364 lines (301 loc) · 7.58 KB
/
klayout.pri
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
TL_INC = $$PWD/tl/tl
DB_INC = $$PWD/db/db
DRC_INC = $$PWD/drc/drc
LVS_INC = $$PWD/lvs/lvs
EDT_INC = $$PWD/edt/edt
EXT_INC = $$PWD/ext/ext
GSI_INC = $$PWD/gsi/gsi
ANT_INC = $$PWD/ant/ant
RDB_INC = $$PWD/rdb/rdb
IMG_INC = $$PWD/img/img
LYM_INC = $$PWD/lym/lym
LIB_INC = $$PWD/lib/lib
LAYBASIC_INC = $$PWD/laybasic/laybasic
LAYVIEW_INC = $$PWD/layview/layview
LAYUI_INC = $$PWD/layui/layui
LAY_INC = $$PWD/lay/lay
DOC_INC = $$PWD/doc
ICONS_INC = $$PWD/icons
QTBASIC_INC = $$PWD/gsiqt/qtbasic
BD_INC = $$PWD/buddies/src/bd
VERSION_INC = $$PWD/version
equals(HAVE_RUBY, "1") {
RBA_INC = $$PWD/rba/rba
RBA_LIB = klayout_rba
} else {
RBA_INC = $$PWD/rbastub
RBA_LIB = klayout_rbastub
}
equals(HAVE_PYTHON, "1") {
PYA_INC = $$PWD/pya/pya
PYA_LIB = klayout_pya
} else {
PYA_INC = $$PWD/pyastub
PYA_LIB = klayout_pyastub
}
equals(HAVE_QTBINDINGS, "1") {
DEFINES += HAVE_QTBINDINGS
}
!equals(HAVE_QT_UITOOLS, "0") {
# auto-select uitools, not all distributions have it
contains(QT_MODULES, "uitools") {
HAVE_QT_UITOOLS = 1
} else {
HAVE_QT_UITOOLS = 0
}
}
equals(HAVE_64BIT_COORD, "1") {
DEFINES += HAVE_64BIT_COORD
}
equals(HAVE_PYTHON, "1") {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/python/python.pri)
}
DEFINES += HAVE_PYTHON
}
equals(HAVE_CURL, "1") {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/curl/curl.pri)
} else {
LIBS += -lcurl
win32 {
LIBS += -lwsock32 # required because we do "select"
}
}
DEFINES += HAVE_CURL
}
equals(HAVE_PNG, "1") {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/png/png.pri)
} else {
LIBS += -lpng
}
DEFINES += HAVE_PNG
}
equals(HAVE_EXPAT, "1") {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/expat/expat.pri)
} else {
LIBS += -lexpat
}
DEFINES += HAVE_EXPAT
}
equals(HAVE_PTHREADS, "1") {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/ptw/ptw.pri)
} else {
LIBS += -lpthread
}
DEFINES += HAVE_PTHREADS
}
equals(HAVE_GIT2, "1") {
!mac {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/git2/git2.pri)
} else {
LIBS += -lgit2
}
} else {
QMAKE_INCDIR += $$(MAC_LIBGIT2_INC)
QMAKE_LFLAGS += -L$$(MAC_LIBGIT2_LIB)
LIBS += -lgit2
}
DEFINES += HAVE_GIT2
}
# Use the Address Sanitizer for the debug build on Mac
mac {
USE_ASAN_MAC = $$system(echo $$(MAC_USE_ASAN))
equals(USE_ASAN_MAC, "1") {
QMAKE_CXXFLAGS += -fsanitize=address
QMAKE_LFLAGS += -fsanitize=address
}
}
equals(HAVE_RUBY, "1") {
!isEmpty(BITS_PATH) {
include($$BITS_PATH/ruby/ruby.pri)
}
DEFINES += \
HAVE_RUBY \
HAVE_RUBY_VERSION_CODE=$$RUBYVERSIONCODE
}
!isEmpty(RPATH) {
QMAKE_RPATHDIR += $$RPATH
}
!isEmpty(BITS_PATH) {
include($$BITS_PATH/zlib/zlib.pri)
} else {
!msvc {
LIBS += -lz
}
}
equals(HAVE_CRONOLOGY, "1") {
DEFINES += HAVE_CRONOLOGY
LIBS += $$CRONOLOGY_LIB
INCLUDEPATH += $$CRONOLOGY_INCLUDE
}
!lessThan(QT_MAJOR_VERSION, 6) {
# internal resource readers to not support zstd so far
QMAKE_RESOURCE_FLAGS += --compress-algo zlib
}
msvc {
QMAKE_CXXFLAGS += \
/bigobj \
/wd4251 # Disable "DLL interface required"
lessThan(QT_MAJOR_VERSION, 6) {
# MSVC 2017 needs this option:
QMAKE_CXXFLAGS += \
/source-charset:utf-8 \ # Use UTF-8 for source files
}
QMAKE_LFLAGS += \
/OPT:NOREF \ # preserves functions we want to keep for implementing the "force link" mechanism
QMAKE_CXXFLAGS_WARN_ON += \
# for stack trace support:
# lpsapi for GetModuleFileName and others
# dbghelp for SymFromAddr and other
LIBS += -lpsapi -ldbghelp
} else {
CONFIG(gcov) {
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
QMAKE_LFLAGS += --coverage
}
QMAKE_CXXFLAGS_WARN_ON += \
-pedantic \
-Woverloaded-virtual \
-Wsynth \
-Wno-deprecated \
-Wno-long-long \
-Wno-strict-aliasing \
-Wno-deprecated-declarations \
# too noisy on Qt:
# QMAKE_CXXFLAGS_WARN_ON += \
# -Wsign-promo \
# -Wno-reserved-user-defined-literal \
#
lessThan(QT_MAJOR_VERSION, 6) {
# because we use unordered_map/unordered_set:
QMAKE_CXXFLAGS += -std=c++11
} else {
# because we use unordered_map/unordered_set:
QMAKE_CXXFLAGS += -std=c++17
}
win32 {
QMAKE_LFLAGS += -Wl,--exclude-all-symbols
# for stack trace support:
# lpsapi for GetModuleFileName and others
# dbghelp for SymFromAddr and other
LIBS += -lpsapi -ldbghelp
QMAKE_CXXFLAGS += -Wa,-mbig-obj
} else {
QMAKE_CXXFLAGS += -fvisibility=hidden
}
*bsd* {
# stack trace support
LIBS += -lexecinfo
}
}
equals(HAVE_QT, "0") {
QT =
# fake qrc made with python
!equals(HAVE_PYTHON, "0") {
new_qrc.output = qrc_${QMAKE_FILE_BASE}.cc
new_qrc.commands = $$PYTHON $$PWD/../scripts/pyqrc.py ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
new_qrc.depend_command = $$PYTHON $$PWD/../scripts/pyqrc.py ${QMAKE_FILE_NAME}
new_qrc.input = RESOURCES
new_qrc.variable_out = SOURCES
new_qrc.CONFIG += dep_lines
QMAKE_EXTRA_COMPILERS += new_qrc
}
} else {
DEFINES += HAVE_QT
QT += core xml network
greaterThan(QT_MAJOR_VERSION, 5) {
QT += core5compat
}
equals(HAVE_QTBINDINGS, "1") {
# sql isn't needed by the base application
!equals(HAVE_QT_SQL, "0") {
QT += sql
}
}
greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets gui printsupport
equals(HAVE_QTBINDINGS, "1") {
!equals(HAVE_QT_DESIGNER, "0") {
# designer isn't needed by the base application
QT += designer
}
!equals(HAVE_QT_MULTIMEDIA, "0") {
# multimedia isn't needed by the base application
QT += multimedia multimediawidgets
}
!equals(HAVE_QT_SVG, "0") {
# svg isn't needed by the base application
QT += svg
}
!equals(HAVE_QT_UITOOLS, "0") {
# uitools isn't needed by the base application
QT += uitools
}
!equals(HAVE_QT_XML, "0") {
lessThan(QT_MAJOR_VERSION, 6) {
QT += xmlpatterns
}
}
}
} else {
equals(HAVE_QTBINDINGS, "1") {
!equals(HAVE_QT_DESIGNER, "0") {
# designer isn't needed by the base application
CONFIG += designer
}
!equals(HAVE_QT_UITOOLS, "0") {
# uitools isn't needed by the base application
CONFIG += uitools
}
}
}
!equals(HAVE_QT_UITOOLS, "0") {
DEFINES += HAVE_QT_UITOOLS
}
!equals(HAVE_QT_NETWORK, "0") {
DEFINES += HAVE_QT_NETWORK
}
!equals(HAVE_QT_SQL, "0") {
DEFINES += HAVE_QT_SQL
}
!equals(HAVE_QT_SVG, "0") {
DEFINES += HAVE_QT_SVG
}
!equals(HAVE_QT_PRINTSUPPORT, "0") {
DEFINES += HAVE_QT_PRINTSUPPORT
}
!equals(HAVE_QT_MULTIMEDIA, "0") {
DEFINES += HAVE_QT_MULTIMEDIA
}
!equals(HAVE_QT_DESIGNER, "0") {
DEFINES += HAVE_QT_DESIGNER
}
!equals(HAVE_QT_XML, "0") {
DEFINES += HAVE_QT_XML
}
}
VERSION_STRING = $$KLAYOUT_VERSION
VERSION_STRING_WITH_BLANKS = $$replace(VERSION_STRING, "\\.", " ")
eval(VERSION_ARRAY = $$VERSION_STRING_WITH_BLANKS)
KLAYOUT_MAJOR_VERSION = $$member(VERSION_ARRAY, 0)
KLAYOUT_MINOR_VERSION = $$member(VERSION_ARRAY, 1)
KLAYOUT_TINY_VERSION = $$member(VERSION_ARRAY, 2)
isEmpty(KLAYOUT_TINY_VERSION) {
KLAYOUT_TINY_VERSION = 0
}
DEFINES += \
KLAYOUT_VERSION=$$KLAYOUT_VERSION \
KLAYOUT_VERSION_REV=$$KLAYOUT_VERSION_REV \
KLAYOUT_VERSION_DATE=$$KLAYOUT_VERSION_DATE \
KLAYOUT_MAJOR_VERSION=$$KLAYOUT_MAJOR_VERSION \
KLAYOUT_MINOR_VERSION=$$KLAYOUT_MINOR_VERSION \
KLAYOUT_TINY_VERSION=$$KLAYOUT_TINY_VERSION \
VERSION = $$KLAYOUT_VERSION
CONFIG(debug, debug|release) {
DEFINES += HAVE_DEBUG
}