-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathBUSY
624 lines (516 loc) · 16.7 KB
/
BUSY
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
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
# Copyright (C) 2022 Rochus Keller ([email protected]) for LeanQt
# licensed under GPL/LGPL
param HAVE_SHARED = false # if true build shared instead of static libraries, and export marked symbols
#param HAVE_DEBUG = false # no longer supported; use -M debug instead
#param HAVE_NOOPT = false # no longer supported; use -M nonoptimized instead
param HAVE_GEOM = false # include geometry classes like QRect, QPoint etc.
param HAVE_JSON = false # include QJsonObject and friends
param HAVE_XMLSTREAM = false # include QXmlStreamWriter, QXmlStreamReader, etc.
param HAVE_URL = false # include QUrl and support classes
param HAVE_DSTREAM = false # include QDataStream
param HAVE_CMDLINE = false # include QCommandLineParser and QCommandLineOption
param HAVE_PROCESS = false # include QProcess
param HAVE_SHAREDMEM = false # include QSharedMemory and QSystemSemaphore
param HAVE_ZLIB = false # include qCompress
param HAVE_MIME = false # include QMimeType and QMimeDatabase
param HAVE_THREADS = false # include QThread and friends
param HAVE_FILEIO = false # include QFile, QFileInfo, QDir, QSettings etc.
param HAVE_COREAPP = false # include QCoreApplication, QTranslator
param HAVE_OBJECT = false # include QObject, QEvent, QEventDispatcher etc.
param HAVE_LIBRARY = false # include QLibrary
param HAVE_PLUGINS = false # include QPluginLoader
param HAVE_RE = false # include QRecularExpression, using pcre16
param HAVE_CORE_ALL = false # switches on all flags which add code
param HAVE_SSL = false # include QSslSocket and friends; only OpenSSL dynamic loading supported so far
param HAVE_LOCALSOCK = false # include QLocalSocket and QLocalServer
param HAVE_NETACCESS = false # include QNetworkAccessManager and friends
param HAVE_BEARER = false # include QNetworkConfiguration, QNetworkSession and friends
param HAVE_AUTH = false # include QAuthenticator
param HAVE_NET_ALL = false # switches on all flags which add code
param HAVE_NET_MINIMUM = false # takes care that core is compiled with HAVE_OBJECT and HAVE_URL support
param HAVE_XML = false # takes care that libqt included QtXml classes
param HAVE_CONCURRENT = false # takes care that core is compiled with HAVE_THREADS support
param HAVE_IMAGE = false # takes care that core is compiled with HAVE_GEOM and HAVE_DSTREAM support
param HAVE_GUI = false # takes care that core is compiled with HAVE_IMAGE and HAVE_OBJECT
param HAVE_FONTCONFIG = false # Linux GUI option; use fontconfig to locate fonts; otherwise use the path provided via QT_QPA_FONTDIR
# environment variable, or applicationDirPath() + "/fonts", or QStandardPaths::FontsLocation; requires -lfontconfig
param HAVE_SYS_FT = false # Use the freetype library of the system instead of the integrated one; only relevant on Linuy
param HAVE_WIDGETS = false # takes care that GUI is enabled
param HAVE_ITEMVIEWS = false # takes care that WIDGETS is enabled
param HAVE_GRAPHICS = false # takes care that WIDGETS is enabled
param HAVE_ALL = false # enbles all features
# NOTE: not all possible combinations on all platforms have been tested;
# patches are welcome, in case you find a combination which doesn't work
if busy_version < "2023-02-12" {
error("this version of BUSY is not compatible with this build")
}
if HAVE_ALL {
HAVE_CORE_ALL = true; HAVE_NET_ALL = true; HAVE_XML = true; HAVE_CONCURRENT = true;
HAVE_IMAGE = true; HAVE_GUI = true; HAVE_WIDGETS = true; HAVE_ITEMVIEWS = true; HAVE_GRAPHICS = true;
}
if HAVE_CORE_ALL {
HAVE_GEOM = true; HAVE_JSON = true; HAVE_XMLSTREAM = true; HAVE_URL = true; HAVE_DSTREAM = true
HAVE_FILEIO = true; HAVE_COREAPP = true; HAVE_OBJECT = true; HAVE_CMDLINE = true; HAVE_THREADS = true
HAVE_LIBRARY = true; HAVE_PROCESS = true; HAVE_SHAREDMEM = true; HAVE_PLUGINS = true; HAVE_ZLIB = true
}
if HAVE_NET_ALL {
HAVE_SSL = true; HAVE_LOCALSOCK = true; HAVE_NETACCESS = true; HAVE_BEARER = true; HAVE_AUTH = true
}
if HAVE_NET_MINIMUM || HAVE_SSL || HAVE_LOCALSOCK || HAVE_NETACCESS || HAVE_BEARER || HAVE_AUTH {
HAVE_NET_MINIMUM = true
if !HAVE_OBJECT || !HAVE_URL {
message("enabling HAVE_OBJECT and HAVE_URL required by the network module")
HAVE_OBJECT = true
HAVE_URL = true
}
}
if HAVE_GRAPHICS && !HAVE_WIDGETS {
message("enabling HAVE_WIDGETS required by HAVE_GRAPHICS")
HAVE_WIDGETS = true
}
if HAVE_ITEMVIEWS && !HAVE_WIDGETS {
message("enabling HAVE_WIDGETS required by HAVE_ITEMVIEWS")
HAVE_WIDGETS = true
}
if HAVE_WIDGETS && !HAVE_GUI {
message("enabling HAVE_GUI required by HAVE_WIDGETS")
HAVE_GUI = true
}
if HAVE_WIDGETS && (target_os == `macos) && !HAVE_LIBRARY {
message("enabling HAVE_LIBRARY required by QMacStyle")
HAVE_LIBRARY = true
}
if HAVE_GUI && !HAVE_IMAGE {
message("enabling HAVE_IMAGE required by HAVE_GUI")
HAVE_IMAGE = true
}
if HAVE_GUI && !HAVE_OBJECT {
message("enabling HAVE_OBJECT required by HAVE_GUI")
HAVE_OBJECT = true
}
if HAVE_GUI && !HAVE_FILEIO {
message("enabling HAVE_FILEIO required by HAVE_GUI")
HAVE_FILEIO = true
}
if HAVE_GUI && !HAVE_URL {
message("enabling HAVE_URL required by HAVE_GUI")
HAVE_URL = true
}
if HAVE_GUI && (target_os == `macos) && !HAVE_MIME {
message("enabling HAVE_MIME required by HAVE_GUI on macOS")
HAVE_MIME = true
}
if HAVE_IMAGE && !HAVE_DSTREAM {
message("enabling HAVE_DSTREAM required by HAVE_IMAGE")
HAVE_DSTREAM = true
}
if HAVE_IMAGE && !HAVE_GEOM {
message("enabling HAVE_GEOM required by HAVE_IMAGE")
HAVE_GEOM = true
}
if HAVE_CONCURRENT && !HAVE_THREADS {
message("enabling HAVE_TRHEADS required by HAVE_CONCURRENT")
HAVE_THREADS = true
}
if HAVE_BEARER && !HAVE_PLUGINS {
message("enabling HAVE_PLUGINS required by HAVE_BEARER")
HAVE_PLUGINS = true
}
if HAVE_SSL && !HAVE_LIBRARY {
message("enabling HAVE_LIBRARY required by HAVE_SSL")
HAVE_LIBRARY = true
}
if HAVE_SSL && !HAVE_AUTH {
message("enabling HAVE_AUTH required by HAVE_SSL")
HAVE_AUTH = true
}
if HAVE_AUTH && !HAVE_DSTREAM {
message("enabling HAVE_DSTREAM required by HAVE_AUTH")
HAVE_DSTREAM = true
}
if HAVE_NETACCESS && !HAVE_DSTREAM {
message("enabling HAVE_DSTREAM required by HAVE_NETACCESS")
HAVE_DSTREAM = true
}
if HAVE_NETACCESS && !HAVE_AUTH {
message("enabling HAVE_AUTH required by HAVE_NETACCESS")
HAVE_AUTH = true
}
if HAVE_PLUGINS && !HAVE_OBJECT {
message("enabling HAVE_OBJECT required by HAVE_PLUGINS")
HAVE_OBJECT = true
}
if HAVE_PLUGINS && !HAVE_LIBRARY {
message("enabling HAVE_LIBRARY required by HAVE_PLUGINS")
HAVE_LIBRARY = true
}
if HAVE_PLUGINS && !HAVE_JSON {
message("enabling HAVE_JSON required by HAVE_PLUGINS")
HAVE_JSON = true
}
if HAVE_SHAREDMEM && !HAVE_FILEIO {
message("enabling HAVE_FILEIO required by HAVE_SHAREDMEM")
HAVE_FILEIO = true
}
if HAVE_LIBRARY && !HAVE_FILEIO {
message("enabling HAVE_FILEIO required by HAVE_LIBRARY")
HAVE_FILEIO = true
}
if HAVE_SHARED && !HAVE_COREAPP {
message("enabling HAVE_COREAPP required by HAVE_SHARED")
HAVE_COREAPP = true
}
if HAVE_OBJECT && !HAVE_COREAPP {
message("enabling HAVE_COREAPP required by HAVE_OBJECT")
HAVE_COREAPP = true
}
if HAVE_OBJECT && !HAVE_THREADS {
message("enabling HAVE_THREADS required by HAVE_OBJECT")
HAVE_THREADS = true
}
######################################################################
# NOTE: on Windows with HAVE_SHARED and HAVE_NOOPT VC2013 and 2017 generated qtwidgets.dll causes a crash on load
# if the object files presented to the linker don't follow a specific order; the linker doesn't issue any warning or error;
# same for x86 and x64. The crash can be avoided if the moc generated files precede the other object files in the order;
# this can be done on BUSY file level by e.g. adding the Moc instance to the deps list of the other files SourceSet.
# The order isn't relevant with HAVE_SHARED and no HAVE_NOOPT, or without HAVE_SHARED.
# The same applies to HAVE_DEBUG with HAVE_SHARED and the debug build in QtCreator with the generated qmake
# project files; in QtCreator the cdb.exe process simply crashes with no useful log output
let root_path - = relpath()
######################################################################
submod core
let _core_sources - = core.sources # see below for public core_sources
let _core_config - = core.config
let _core_linker_config - : Config {
if target_os == `win32 {
.lib_names = [
"Gdi32" "User32" "Shell32" "Comdlg32" "Advapi32" "Ole32" "Ws2_32"
]
if target_toolchain == `gcc {
# gcc on windows
.lib_names += [ "stdc++" "m" ]
.ldflags += "-shared-libgcc"
}
} else {
.lib_names += [ "stdc++" "m" ]
.ldflags += "-shared-libgcc"
if (target_os == `linux) && (
((target_toolchain == `gcc) && (target_toolchain_ver >= 0600))
|| ((target_toolchain == `clang) && (target_toolchain_ver >= 080000))) {
# some Linux with more recent gcc require to recognize an executable
.ldflags += "-no-pie"
}
if HAVE_THREADS || HAVE_PROCESS {
.lib_names += "pthread"
}
if HAVE_LIBRARY {
.lib_names += "dl"
}
if target_os == `macos {
.frameworks += [ "IOKit" "Foundation" "CoreServices" "AppKit" "ApplicationServices" "CoreFoundation" ]
}
}
}
let core_client_config * : Config {
.configs += [ _core_config _core_linker_config ]
}
######################################################################
submod mime else ./missing.busy
# mime is optional part of core
######################################################################
submod xml else ./missing.busy
let xml_sources * = xml.sources
let xml_client_config * = xml.config
######################################################################
submod net else ./missing.busy
let net_sources * = net.sources
let _net_config - = net.config
let _net_linker_config - : Config {
if target_os == `win32 {
.lib_names = [
"Dnsapi" "Iphlpapi"
]
if HAVE_SSL {
.lib_names += "Crypt32"
}
}
if target_os == `macos {
.frameworks += [ "SystemConfiguration" "Security" ]
}
}
let net_client_config * : Config {
.configs += [ _net_config _net_linker_config ]
}
######################################################################
submod concurrent else ./missing.busy
let concurrent_sources * = concurrent.sources
let concurrent_client_config * = concurrent.config
######################################################################
submod image else ./missing.busy
let image_sources * = image.sources
let _image_config - = image.config
# use either image_client_config or gui_client_config, but not both
let image_client_config * = image.config
######################################################################
submod gui else ./missing.busy
let _gui_sources = gui.sources # see below for public gui_sources
let _gui_config - = gui.config
let gui_client_config * : Config {
.configs += [ image_client_config _gui_config ]
if (target_os == `linux) && HAVE_SYS_FT {
.lib_names += "freetype"
}
}
######################################################################
let QT_STYLE_OVERRIDE- = "fusion"
submod widgets else ./missing.busy
let widgets_sources * = widgets.sources
let _widgets_config - = widgets.config
let widgets_client_config * = widgets.config
######################################################################
submod itemviews else ./missing.busy
let itemviews_sources * = itemviews.sources
let itemviews_client_config * = itemviews.config
######################################################################
submod graphics else ./missing.busy
let graphics_sources * = graphics.sources
let graphics_client_config * = graphics.config
######################################################################
submod tools
let copy_uic * : Copy {
.use_deps += `executable
.deps += tools.uic.exe;
.outputs += root_path + ./{{source_file_part}}
}
let copy_moc * : Copy {
.use_deps += `executable
.deps += tools.moc.exe;
.outputs += root_path + ./{{source_file_part}}
}
let copy_rcc * : Copy {
.use_deps += `executable
.deps += tools.rcc.exe;
.outputs += root_path + ./{{source_file_part}}
}
######################################################################
let core_sources * : Group {
if HAVE_OBJECT {
.deps += copy_moc
}
.deps += _core_sources
if HAVE_MIME {
.deps += mime.sources
}
}
let gui_sources * : Group {
if (target_os == `macos) || (target_os == `win32) || HAVE_WIDGETS {
.deps += copy_rcc
}
if HAVE_ITEMVIEWS {
.deps += copy_uic
}
.deps += _gui_sources
}
######################################################################
## Separate libraries
let libqtcore * : Library {
.deps += core_sources
if HAVE_SHARED {
.lib_type = `shared
.configs += core_client_config
}else{
.lib_type = `static
}
.name = "qtcore"
}
let libqtxml * : Library {
.deps += xml_sources
if HAVE_SHARED {
.lib_type = `shared
.configs += core_client_config;
.deps += libqtcore
}else{
.lib_type = `static
}
.name = "qtxml"
}
let libqtnetwork * : Library {
.deps += net_sources
if HAVE_SHARED {
.lib_type = `shared
.configs += [ core_client_config net_client_config ]
.deps += libqtcore
}else{
.lib_type = `static
}
.name = "qtnetwork"
}
let libqtconcurrent * : Library {
.deps += concurrent_sources
if HAVE_SHARED {
.lib_type = `shared
.configs += [ core_client_config concurrent_client_config ]
.deps += libqtcore
}else{
.lib_type = `static
}
.name = "qtconcurrent"
}
let libqtimage * : Library {
.deps += image_sources
if HAVE_SHARED {
.lib_type = `shared
.configs += [ core_client_config image_client_config ]
.deps += libqtcore
}else{
.lib_type = `static
}
.name = "qtimage"
}
# either use libqtgui or libqtimage, but not both
let libqtgui * : Library {
.deps += [ image_sources gui_sources ]
if HAVE_SHARED {
.lib_type = `shared
.configs += [ core_client_config gui_client_config ]
.deps += libqtcore
}else{
.lib_type = `static
}
.name = "qtgui"
}
# use libqtwinmain for Windows applications (with both static or shared libqtgui)
let libqtwinmain * : Library {
.sources += ./gui/windows/qtmain_win.cpp
.lib_type = `static
.name = "qtwinmain"
.configs += _core_config
}
let libqtwidgets * : Library {
.deps += widgets_sources
if HAVE_SHARED {
.lib_type = `shared
.configs += [ core_client_config gui_client_config widgets_client_config ]
.deps += [ libqtcore libqtgui ]
}else{
.lib_type = `static
}
if HAVE_ITEMVIEWS {
.deps += itemviews_sources
}
if HAVE_GRAPHICS {
.deps += graphics_sources
}
.name = "qtwidgets"
}
######################################################################
## All in one library
# use this Config instead of the above X_client_config when you use libqt
let qt_client_config * : Config {
.configs += core_client_config
if HAVE_XML {
.configs += xml_client_config
}
if HAVE_NET_MINIMUM {
.configs += net_client_config
}
if HAVE_CONCURRENT {
.configs += concurrent_client_config
}
if HAVE_IMAGE && !HAVE_GUI {
.configs += image_client_config
}
if HAVE_GUI {
.configs += gui_client_config
}
if HAVE_WIDGETS {
.configs += widgets_client_config
}
if HAVE_GRAPHICS {
.configs += graphics_client_config
}
}
# use this library instead of the above libqtX to ease deployment;
# libqtwinmain is still required on Windows
let libqt * : Library {
.deps += core_sources
if HAVE_XML {
.deps += xml_sources
}
if HAVE_NET_MINIMUM {
.deps += net_sources
}
if HAVE_CONCURRENT {
.deps += concurrent_sources
}
if HAVE_IMAGE {
.deps += image_sources
}
if HAVE_GUI {
.deps += gui_sources
}
if HAVE_WIDGETS {
.deps += widgets_sources
}
if HAVE_ITEMVIEWS {
.deps += itemviews_sources
}
if HAVE_GRAPHICS {
.deps += graphics_sources
}
if HAVE_SHARED {
.lib_type = `shared
.configs += qt_client_config
}else{
.lib_type = `static
}
.name = "qt"
}
######################################################################
submod addons
let libqtsingleapp * : Library {
.lib_type = `static
.name = "qtsingleapp"
.deps += addons.singleapp.sources
}
######################################################################
## Examples
submod examples
let build_examples ! : Copy {
.use_deps += `executable
.deps += examples.hello
if HAVE_OBJECT {
.deps += examples.objects
}
if HAVE_THREADS {
.deps += examples.threads
}
if HAVE_PROCESS {
.deps += examples.process
}
if HAVE_NET_MINIMUM && HAVE_CMDLINE {
.deps += examples.dnslookup
}
if HAVE_CONCURRENT {
.deps += examples.runner
}
if HAVE_NETACCESS && HAVE_FILEIO {
.deps += examples.download
}
if HAVE_IMAGE {
.deps += examples.transform
}
if HAVE_GUI {
.deps += examples.clock
}
if HAVE_WIDGETS {
.deps += [ examples.calculator examples.mainwindow ]
}
if HAVE_ITEMVIEWS {
.deps += [ examples.chart examples.colorlist ]
}
if HAVE_GRAPHICS {
.deps += [ examples.elasticnodes examples.anchorlayout ]
}
.outputs += root_path + ./{{source_file_part}}
}