-
Notifications
You must be signed in to change notification settings - Fork 30
/
BUSY
198 lines (173 loc) · 5.04 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
# author: Rochus Keller ([email protected])
# License: GPL
# See https://github.com/rochus-keller/LeanQt and https://github.com/rochus-keller/BUSY/blob/main/README.md on how to use this file
# param HAVE_NOOPT = false # no longer supported; use -M nonoptimized instead
if busy_version < "2023-01-15" {
error("this version of BUSY is not compatible with this build")
}
let mtconf : Config {
.cflags = [ "/O2", "/MT" ]
}
if (build_mode == `optimized) && (target_toolchain == `msvc) {
set_defaults(target_toolchain,mtconf)
}
submod qtmini = ../LeanQt (HAVE_FILEIO, HAVE_COREAPP, HAVE_PROCESS)
submod qtfull = ../LeanQt (HAVE_ITEMVIEWS, HAVE_PROCESS, HAVE_NET_MINIMUM)
let compiler_files = [
./ObToken.cpp
./ObLexer.cpp
./ObFileCache.cpp
./ObErrors.cpp
./ObRowCol.cpp
./ObxValidator.cpp
./ObxProject.cpp
./ObxParser.cpp
./ObxPackage.cpp
./ObxModel.cpp
./ObxEvaluator.cpp
./ObxAst.cpp
./ObTokenType.cpp
./ObxIlEmitter.cpp
./ObxPelibGen.cpp
./ObxCilGen.cpp
../MonoTools/MonoMdbGen.cpp
./ObxCGen2.cpp
]
let ide_files = [
../GuiTools/AutoMenu.cpp
../GuiTools/AutoShortcut.cpp
../GuiTools/AutoToolBar.cpp
../GuiTools/NamedFunction.cpp
../GuiTools/UiFunction.cpp
../GuiTools/CodeEditor.cpp
../GuiTools/DocSelector.cpp
../GuiTools/DocTabWidget.cpp
../MonoTools/MonoEngine.cpp
../MonoTools/MonoDebugger.cpp
../MonoTools/MonoIlView.cpp
./ObnHighlighter.cpp
./ObxIde2.cpp
]
# TODO: look for a better solution how to e.g. pass a Qt config to a pelib BUSY file instead
let pelib_files = [
../PeLib/AssemblyDef.cpp
../PeLib/bigdigits.cpp
../PeLib/Class.cpp
../PeLib/CodeContainer.cpp
../PeLib/CreateGUID.cpp
../PeLib/CustomAttributeContainer.cpp
../PeLib/DataContainer.cpp
../PeLib/Enum.cpp
../PeLib/Field.cpp
../PeLib/Instruction.cpp
../PeLib/Method.cpp
../PeLib/MethodSignature.cpp
../PeLib/Namespace.cpp
../PeLib/SignatureGenerator.cpp
../PeLib/Operand.cpp
../PeLib/PELib.cpp
../PeLib/PELibError.cpp
../PeLib/PEWriter.cpp
../PeLib/Property.cpp
../PeLib/Qualifiers.cpp
../PeLib/RSAEncoder.cpp
../PeLib/sha1.cpp
../PeLib/Type.cpp
../PeLib/Value.cpp
../PeLib/Resource.cpp
../PeLib/PEMetaTables.cpp
../PeLib/Stream.cpp
]
let pelib_config : Config {
.include_dirs += ..
.defines += [ "HAVE_C99INCLUDES" "QT_CORE_LIB" ]
if (target_toolchain == `gcc) || (target_toolchain == `clang) {
.cflags_cc += "-std=c++11"
}
}
let pelib_compiler : SourceSet {
.sources += pelib_files;
.configs += [ pelib_config qtmini.core_client_config ]
}
let pelib_ide : SourceSet {
.sources += pelib_files;
.configs += [ pelib_config qtfull.core_client_config ]
}
let imp_config : Config {
.include_dirs += ..
.defines += [ "_HAS_GENERICS" "OBX_BBOX" "_OBX_USE_NEW_FFI_" ]
.cflags_cc += pelib_config.cflags_cc # c++11 even in Pelib headers
}
let compiler_only_rcc : Rcc {
.deps += qtmini.copy_rcc;
.tool_dir = root_build_dir + relpath(qtmini);
.sources += ./OBXMC.qrc
}
let compiler_only ! : Executable {
.configs += [ imp_config qtmini.core_client_config ]
.sources += ./ObxMcMain.cpp + compiler_files ;
.deps += [ qtmini.copy_rcc pelib_compiler qtmini.core_sources compiler_only_rcc ]
.cflags_cc += pelib_config.cflags_cc ; # c++11 even in Pelib headers
.name = "OBXMC"
}
let compiler_moc : Moc {
.sources += ./ObxProject.h
}
let compiler_rcc : Rcc {
.sources += ./OBXMC.qrc
}
let compiler* : Executable {
.configs += [ imp_config qtfull.core_client_config ]
.sources += ./ObxMcMain.cpp + compiler_files ;
.deps += [ qtfull.copy_rcc pelib_ide qtfull.core_sources compiler_rcc compiler_moc ]
.name = "OBXMC"
}
let ide_moc : Moc {
.sources += [
../GuiTools/UiFunction.h
../GuiTools/AutoShortcut.h
../GuiTools/AutoMenu.h
../MonoTools/MonoIlView.h
../MonoTools/MonoDebugger.h
../MonoTools/MonoEngine.h
../GuiTools/DocTabWidget.h
../GuiTools/DocSelector.h
../GuiTools/CodeEditor.h
./ObxIde2.h
]
}
let ide_rcc : Rcc {
.sources += [ ./ObxIde2.qrc ./Font2.qrc ]
}
let ide * : Executable {
.configs += [ imp_config qtfull.qt_client_config ]
.deps += [ pelib_ide qtfull.libqt ide_rcc compiler_moc ide_moc ]
.sources += compiler_files + ide_files;
.defines += [ "_MONO_ENGINE_EXT_" "_OBX_USE_NEW_FFI_" ]
if target_os == `win32 {
.deps += qtfull.libqtwinmain
}
.name = "ObxIDE"
}
let pal * : Library {
# NOTE: this doesn't work on x86_64 because everything is supposed to be compiled with fPIC
# use the separate BUSY in the Pal directory to build the shared library instead
.lib_type = `shared
.configs += [ imp_config qtfull.qt_client_config ]
.deps += [ qtfull.libqtcore qtfull.libqtgui ]
.sources = [
./runtime/Pal/File.cpp
./runtime/Pal/Display.cpp
./runtime/Pal/Math.cpp
]
.name = "Pal"
}
let compiler_and_ide * : Group {
.deps += [ compiler ide ]
if !((target_os == `linux) && (target_wordsize == `64)) {
.deps += [ pal ]
}
}
let all * : Group {
.deps += [ compiler ide pal ]
}