-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPADrend.ekki
567 lines (490 loc) · 20.4 KB
/
PADrend.ekki
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
/*
* This file is part of the open source part of the
* Platform for Algorithm Development and Rendering (PADrend).
* Web page: http://www.padrend.de/
* Copyright (C) 2013-2015 Claudius Jähn <[email protected]>
*
* PADrend consists of an open source part and a proprietary part.
* The open source part of PADrend is subject to the terms of the Mozilla
* Public License, v. 2.0. You should have received a copy of the MPL along
* with this library; see the file LICENSE. If not, you can obtain one at
* http://mozilla.org/MPL/2.0/.
*/
try{
/*
\todo
- add external library configuration to config
- graphviz generator
- Minsg extension dependencies (minsg_add_dependencies)
*/
Runtime.setLoggingLevel(Runtime.LOG_PEDANTIC_WARNING);
outln("-"*79);
outln("This script creates a CodeBlocks project file for PADrend using EkkiEkkiKateng.");
outln("PADrend: http://PADrend.de");
outln("CodeBlocks: http://www.codeblocks.org");
outln("EkkiEkkiKateng: https://github.com/ClaudiusJ/EkkiEkkiKateng");
outln("-"*79);
outln("EScript version: ",EScript.VERSION_STRING);
// ---------------------------------------------------------------------------
outln("Init EScript Std library...");
static module;
if(EScript.VERSION<701){ // pre-Egon
loadOnce(IO.dirname(args[0])+"/Std/basics.escript"); // load Std lib
module = Std.require;
}else{
//addSearchPath(__DIR__ + "/..");
module = load( IO.dirname(args[0])+ "/Std/module.escript"); // load Std lib module loader
module.addSearchPath( IO.condensePath(IO.dirname(args[0])) );
module.addSearchPath( IO.condensePath(IO.dirname(args[0])+"\\..") ); // search path for EkkiEkkiKateng
//outln( IO.condensePath(IO.dirname(args[0])+"/..") );
}
static Set = module('Std/Set');
static Traits = module('Std/Traits/basics');
// ---------------------------------------------------------------------------
outln("Init EkkiEkkiKateng library...");
outln("EkkiEkkiKateng version: ",module('EkkiEkkiKateng/Version') );
assert(module('EkkiEkkiKateng/Version') >= 0.1);
static CompilerOptions = module('EkkiEkkiKateng/CompilerOptions');
static ExternalLibs = module('EkkiEkkiKateng/ExternalLibs');
static Files = module('EkkiEkkiKateng/Files');
static FileUtils = module('EkkiEkkiKateng/FileUtils');
static LinkerOptions = module('EkkiEkkiKateng/LinkerOptions');
static Node = module('EkkiEkkiKateng/Node');
static Projects = module('EkkiEkkiKateng/Projects');
static Targets = module('EkkiEkkiKateng/Targets');
static VirtualTargets = module('EkkiEkkiKateng/VirtualTargets');
// --------------------------------
// config
var config = new (module('Std/JSONDataStore'))(true);
config.init( __FILE__.substr(0,__FILE__.rFind("."))+".ekki.txt", false);
static folder_base = config.get('Project.Folders.base', IO.condensePath( (__DIR__+"/../").replaceAll('\\','/') ));
static folder_staticLibs = config.get('Project.Folders.libBuild', ".libs");
static folder_objFiles = config.get('Project.Folders.objFiles', ".obj");
static searchFolders_includes = config.get('Project.Folders.thirdPartyIncludes', [folder_base+"ThirdParty/x86_64-w64-mingw32/include"] );
static searchFolders_libs = config.get('Project.Folders.thirdPartyLibs', [folder_base+"ThirdParty/x86_64-w64-mingw32/lib"]);
static additionalLibs_util = config.get('Util.additionalLibs', ["gdi32","psapi"]);
outln("Base folder: ",folder_base);
// --------------------------
// ThirdParty libraries
outln("-"*10);
outln("ThirdParty libraries:");
static simpleFindAndCreateLibNode = fn(String name, String includeSubFolder,String testHeader,Array libFiles, Array includeSearchPaths,Array libSearchPaths){
var includePath;
foreach(includeSearchPaths as var p){
if(IO.isFile(p+"/"+includeSubFolder+"/"+testHeader)){
includePath = p+"/"+includeSubFolder;
break;
}
}
if(!includePath)
return void;
var foundLibSearchPaths = [];
var foundLibFiles = [];
foreach(libFiles as var libFile){
foreach(libSearchPaths as var p){
if(IO.isFile(p+"/"+libFile)){
if(!foundLibSearchPaths.contains(p))
foundLibSearchPaths += p;
if(!foundLibFiles.contains(libFile))
foundLibFiles += libFile;
break;
}
}
}
if(foundLibFiles.empty())
return void;
var n = ExternalLibs.createNode(name);
CompilerOptions.addSearchPath(n, includePath);
foreach(foundLibSearchPaths as var p)
LinkerOptions.addSearchPath(n, p);
foreach(foundLibFiles as var p)
LinkerOptions.addLibrary(n, p.substr(0,p.rFind(".")));
return n;
};
static createSystemLibNode = fn(String name, library){
var n = ExternalLibs.createNode(name);
LinkerOptions.addLibrary(n, library );
return n;
};
static libraries = {
'archive' : simpleFindAndCreateLibNode("archive", "","archive.h",["libarchive.dll.a"],searchFolders_includes,searchFolders_libs),
'bullet' : simpleFindAndCreateLibNode("bullet", "bullet","btBulletDynamicsCommon.h",[
"libBulletCollision.dll.a",
"libBulletDynamics.dll.a",
"libLinearMath.dll.a"
],searchFolders_includes,searchFolders_libs),
'curl' : simpleFindAndCreateLibNode("curl", "","curl/curl.h",["libcurl.dll.a"],searchFolders_includes,searchFolders_libs),
'detri' : simpleFindAndCreateLibNode("detri", "Detri","detri.h",["libDetri.dll.a"],searchFolders_includes,searchFolders_libs),
'freetype' : simpleFindAndCreateLibNode("freetype","freetype2","freetype/freetype.h",["libfreetype.dll.a"],searchFolders_includes,searchFolders_libs),
'gl' : ExternalLibs.createNode("gl"),
'glew' : simpleFindAndCreateLibNode("glew", "","GL/glew.h",["libglew32.dll.a"],searchFolders_includes,searchFolders_libs),
'lpsolve' : simpleFindAndCreateLibNode("lpsolve", "lpsolve","lp_lib.h",["liblpsolve55.dll.a"],searchFolders_includes,searchFolders_libs),
'OpenAL' : simpleFindAndCreateLibNode("OpenAL", "","AL/al.h",["libOpenAL32.dll.a"],searchFolders_includes,searchFolders_libs),
'OpenCL' : simpleFindAndCreateLibNode("OpenCL", "","CL/cl.h",["libOpenCL.dll.a"],searchFolders_includes,searchFolders_libs),
'OpenCOLLADA': void, //! \todo
// simpleFindAndCreateLibNode("OpenCOLLADA", "opencollada/GeneratedSaxParser","GeneratedSaxParser",["libOpenAL32.dll.a"],searchFolders_includes,searchFolders_libs),
'png' : simpleFindAndCreateLibNode("png", "","png.h",["libpng.dll.a"],searchFolders_includes,searchFolders_libs),
'pthread' : createSystemLibNode("pthread", "pthread"),
// 'pthread' : void, // ????????????????????
'serial' : simpleFindAndCreateLibNode("serial", "","serial/serial.h",["libserial.a"],searchFolders_includes,searchFolders_libs),
'sqlite' : simpleFindAndCreateLibNode("sqlite", "","sqlite3.h",["libsqlite3.dll.a"],searchFolders_includes,searchFolders_libs),
'SDL2' : simpleFindAndCreateLibNode("SDL2", "SDL2","SDL.h",["libSDL2.dll.a"],searchFolders_includes,searchFolders_libs),
'SDL2_image': simpleFindAndCreateLibNode("SDL_image","SDL2","SDL_image.h",["libSDL2_image.dll.a"],searchFolders_includes,searchFolders_libs),
'SDL2_net' : simpleFindAndCreateLibNode("SDL2_net","SDL2","SDL_net.h",["libSDL2_net.dll.a"],searchFolders_includes,searchFolders_libs),
'X11' : void, /* Sorry... windows only at the moment */
'XML2' : simpleFindAndCreateLibNode("XML2", "libxml2","libxml/globals.h",["libXML2.dll.a"],searchFolders_includes,searchFolders_libs),
'ZIP' : simpleFindAndCreateLibNode("ZIP", "","zip.h",["libZIP.dll.a"],searchFolders_includes,searchFolders_libs),
'zlib' : simpleFindAndCreateLibNode("zlib", "","zlib.h",["libz.dll.a"],searchFolders_includes,searchFolders_libs),
};
// libfreetype: if no .dll could be created, try the static version:
if(!libraries['freetype']){
var lib = simpleFindAndCreateLibNode("freetype","freetype2","freetype/freetype.h",["libfreetype.a"],searchFolders_includes,searchFolders_libs);
if(lib){
outln("Info: [Freetype] No .dll.a found, using static lib. (Adds zlib to Util)");
libraries['freetype'] = lib;
if(!additionalLibs_util.contains('zlib'))
additionalLibs_util += 'zlib';
}
}
foreach(libraries as var name,var lib)
outln(" - ",name.fillUp(30,"."),(lib?"found":"missing"));
//print_r(libraries);
// -------------------------------------------------------
// -------------------------------------------------------------
// Targets
outln("-"*10);
outln("Targets:");
var createModuleLibTarget = fn(String targetName,String moduleFolder,String libName){
var targetNode = Targets.createNode(targetName);
Targets.setObjectFolder( targetNode, folder_objFiles );
Targets.setOutput( targetNode, folder_staticLibs+"/"+libName );
Targets.setType_StaticLib( targetNode );
CompilerOptions.addOptions( targetNode, [ "-g","-O3" ]);
foreach(FileUtils.scanFiles( folder_base+moduleFolder, [".cpp",".h",".escript",".txt"] ) as var filename){ // ,".rc"
filename = filename.substr(folder_base.length());
if(!filename.contains("- Kopie")&&!filename.contains("/tests/")&&!filename.contains("/examples/")){
targetNode += Files.createNode(filename);
}
}
return targetNode;
};
var createModuleExeTarget = fn(String targetName,String moduleFolder,String exeName){
var targetNode = Targets.createNode(targetName);
Targets.setObjectFolder( targetNode, folder_objFiles );
Targets.setOutput( targetNode, folder_base+"/"+exeName );
Targets.setType_ConsoleApp( targetNode );
CompilerOptions.addOptions( targetNode, [ "-g","-O3" ]);
foreach(FileUtils.scanFiles( folder_base+moduleFolder, [".cpp",".h",".escript",".txt",".rc"] ) as var filename){ // ,".rc"
filename = filename.substr(folder_base.length());
if(!filename.contains("- Kopie")&&!filename.contains("/tests/")&&!filename.contains("/examples/")){
targetNode += Files.createNode(filename);
}
}
return targetNode;
};
var targets = new Map; // the key is used for sorting!
{ // EScript
outln("Target: EScript");
targets["EScript"] = createModuleLibTarget("EScript","modules/EScript","libEScript");
}
{ // Geometry
outln("Target: Geometry");
targets["Geometry"] = createModuleLibTarget("Geometry","modules/Geometry","libGeometry");
}
{ // E_Geometry
outln("Target: E_Geometry");
var target = createModuleLibTarget("E_Geometry","modules/E_Geometry","libE_Geometry");
CompilerOptions.addSearchPath(target, "modules/EScript");
CompilerOptions.addSearchPath(target, "modules");
targets["E_Geometry"] = target;
}
{ // GUI
outln("Target: GUI");
var target = createModuleLibTarget("GUI","modules/GUI","libGUI");
CompilerOptions.addSearchPath(target, "modules");
if(libraries['glew'])
target += libraries['glew'];
else {
Runtime.warn("LibGLEW not found!");
}
targets["GUI"] = target;
}
{ // E_GUI
outln("Target: E_GUI");
var target = createModuleLibTarget("E_GUI","modules/E_GUI","libE_GUI");
CompilerOptions.addSearchPath(target, "modules/EScript");
CompilerOptions.addSearchPath(target, "modules");
targets["E_GUI"] = target;
}
{ // Rendering
outln("Target: Rendering");
var target = createModuleLibTarget("Rendering","modules/Rendering","libRendering");
CompilerOptions.addSearchPath(target, "modules");
LinkerOptions.addLibrary(target,"glu32");
LinkerOptions.addLibrary(target,"opengl32");
if(libraries['glew']){
target += libraries['glew'];
CompilerOptions.addDefine( target, "LIB_GLEW");
outln(" - LIB_GLEW");
}else {
Runtime.warn("LibGLEW not found!");
}
if(libraries['gl']){
target += libraries['gl'];
CompilerOptions.addDefine( target, "LIB_GL");
outln(" - LIB_GL");
}else {
Runtime.warn("LibGL not found!");
}
if(libraries['OpenCL']){
target += libraries['OpenCL'];
CompilerOptions.addDefine( target, "RENDERING_HAS_LIB_OPENCL");
outln(" - RENDERING_HAS_LIB_OPENCL");
}
targets["Rendering"] = target;
}
{ // E_Rendering
outln("Target: E_Rendering");
var target = createModuleLibTarget("E_Rendering","modules/E_Rendering","libE_Rendering");
CompilerOptions.addSearchPath(target, "modules/EScript");
CompilerOptions.addSearchPath(target, "modules");
if(libraries['OpenCL']){
target += libraries['OpenCL'];
CompilerOptions.addDefine( target, "RENDERING_HAS_LIB_OPENCL");
outln(" - RENDERING_HAS_LIB_OPENCL");
}
targets["E_Rendering"] = target;
}
{ // Util and E_Util
outln("Target: Util & E_Util");
var target = createModuleLibTarget("Util","modules/Util","libUtil");
var e_target = createModuleLibTarget("E_Util","modules/E_Util","libE_Util");
CompilerOptions.addSearchPath(e_target, "modules");
CompilerOptions.addSearchPath(e_target, "modules/EScript");
foreach( {
'archive' : "UTIL_HAVE_LIB_ARCHIVE",
'curl' : "UTIL_HAVE_LIB_CURL",
'freetype' : "UTIL_HAVE_LIB_FREETYPE",
'png' : "UTIL_HAVE_LIB_PNG",
'serial' : "UTIL_HAVE_LIB_SERIAL",
'sqlite' : "UTIL_HAVE_LIB_SQLITE",
'SDL2' : "UTIL_HAVE_LIB_SDL2",
'SDL2_image' : "UTIL_HAVE_LIB_SDL2_IMAGE",
'SDL2_net' : "UTIL_HAVE_LIB_SDL2_NET",
'X11' : "UTIL_HAVE_LIB_X11",
'XML2' : "UTIL_HAVE_LIB_XML2",
'ZIP' : "UTIL_HAVE_LIB_ZIP",
'pthread' : "UTIL_HAVE_PTHREAD",
} as var libId, var libDefine){
var lib = libraries[libId];
if(lib){
target += lib;
e_target += lib;
}else{
libDefine = "NO_"+libDefine;
}
CompilerOptions.addDefine( target, libDefine);
CompilerOptions.addDefine( e_target, libDefine);
outln(" - ",libDefine);
}
foreach( additionalLibs_util as var libNameOrId){
if(libraries[libNameOrId]) { // not just a name but the id of a library node...
target += libraries[libNameOrId];
}else{
LinkerOptions.addLibrary(target,libNameOrId);
}
}
targets["Util"] = target;
targets["E_Util"] = e_target;
}
{ // Sound
outln("Target: Sound");
var target = createModuleLibTarget("Sound","modules/Sound","libSound");
CompilerOptions.addSearchPath(target, "modules");
if(libraries['OpenAL']){
target += libraries['OpenAL'];
}else {
Runtime.warn("OpenAL not found!");
}
if(libraries['SDL2']){
target += libraries['SDL2'];
}else {
Runtime.warn("SDL2 not found!");
}
targets["Sound"] = target;
}
{ // E_Sound
outln("Target: E_Sound");
var target = createModuleLibTarget("E_Sound","modules/E_Sound","libE_Sound");
CompilerOptions.addSearchPath(target, "modules/EScript");
CompilerOptions.addSearchPath(target, "modules");
targets["E_Sound"] = target;
}
{ // MinSG
outln("Target: MinSG & E_MinSG");
var target = createModuleLibTarget("MinSG","modules/MinSG","libMinSG");
var e_target = createModuleLibTarget("E_MinSG","modules/E_MinSG","libE_MinSG");
CompilerOptions.addSearchPath(target, "modules");
CompilerOptions.addSearchPath(e_target, "modules");
CompilerOptions.addSearchPath(e_target, "modules/EScript");
// extensions
var extensions = new Map;
var extensionLibDependency = {
'MINSG_EXT_MULTIALGORENDERING' : 'lpsolve',
'MINSG_EXT_TRIANGULATION' : 'detri',
'MINSG_EXT_LOADERCOLLADA' : 'OpenCOLLADA',
'MINSG_EXT_PHYSICS' : 'bullet',
'MINSG_EXT_D3FACT' : 'zlib'
};
// if a required library is not found, disable all dependent extensions by default.
foreach( extensionLibDependency as var extName,var libId){
var lib = libraries[libId];
if(!lib)
extensions[extName] = false;
}
foreach(FileUtils.scanForKeywords("MINSG_EXT_",folder_base+"/modules/MinSG", [".cpp",".h"]) as var name){
if( !name.endsWith("_H") && !extensions.containsKey(name)){
extensions[name] = (name.contains("THESIS") || name.contains("PROFILING") || name.contains("DEBUG")) ? false : true;
}
}
foreach(config.get('MinSG.extensions',new Map) as var name,var enabled){
if(extensions.containsKey(name))
extensions[name] = enabled;
}
config.set('MinSG.extensions',extensions);
foreach(extensions as var name,var enabled){
var define = enabled ? name : "NO_"+name;
CompilerOptions.addDefine( target, define);
CompilerOptions.addDefine( e_target, define);
outln(" - ",define);
}
CompilerOptions.addDefine( target, "WIN32"); // required for lpsolve
// add required libs
foreach( extensionLibDependency as var extName,var libId){
if(extensions[extName]){
var lib = libraries[libId];
if(lib){
target += lib;
}else{
Runtime.warn("["+extName+"] required library '"+libId+"' is missing found!");
}
}
}
targets["MinSG"] = target;
targets["E_MinSG"] = e_target;
}
{ // PADrend main
var containerNode = new Node;
containerNode += targets["EScript"];
containerNode += targets["Geometry"];
containerNode += targets["Util"];
containerNode += targets["Rendering"];
containerNode += targets["GUI"];
containerNode += targets["Sound"];
containerNode += targets["MinSG"];
containerNode += targets["E_Geometry"];
containerNode += targets["E_Util"];
containerNode += targets["E_Rendering"];
containerNode += targets["E_GUI"];
containerNode += targets["E_Sound"];
containerNode += targets["E_MinSG"];
outln("Scanning for script files...");
foreach(FileUtils.scanFiles( folder_base, [".escript",".sfn",".vs",".fs",".ekki",".info"] ) as var filename){
filename = filename.substr(folder_base.length());
containerNode += Files.createNode(filename);
}
{
outln("Target: PADrend main (debug)");
var target = createModuleExeTarget("PADrend (debug)","PADrend","PADrend_Dbg");
// todo add scripts!
CompilerOptions.addSearchPath(target, "modules");
CompilerOptions.addSearchPath(target, "modules/EScript");
CompilerOptions.addDefine( target, "PADREND_HAVE_LIB_E_SOUND");
target += containerNode;
targets["~PADrendDbg"] = target;
}
{
outln("Target: PADrend main (release)");
var target = createModuleExeTarget("PADrend (release)","PADrend","PADrend");
// todo add scripts!
CompilerOptions.addSearchPath(target, "modules");
CompilerOptions.addSearchPath(target, "modules/EScript");
CompilerOptions.addDefine( target, "PADREND_HAVE_LIB_E_SOUND");
LinkerOptions.addOption( target, "-s"); // strip symbols
target += containerNode;
targets["~PADrend"] = target;
}
// ----
}
//---------------------------
{ // all
var vTarget = VirtualTargets.createNode("All");
foreach( targets as var target)
vTarget += target;
targets["All"] = vTarget;
// outln( vTarget.toDbgString() );
}
{
var vTarget = VirtualTargets.createNode("PADrendApp (dbg)");
vTarget += targets["EScript"];
vTarget += targets["Geometry"];
vTarget += targets["Util"];
vTarget += targets["Rendering"];
vTarget += targets["GUI"];
vTarget += targets["Sound"];
vTarget += targets["MinSG"];
vTarget += targets["E_Geometry"];
vTarget += targets["E_Util"];
vTarget += targets["E_Rendering"];
vTarget += targets["E_GUI"];
vTarget += targets["E_Sound"];
vTarget += targets["E_MinSG"];
vTarget += targets["~PADrendDbg"];
targets["PADrendApp(dbg)"] = vTarget;
// outln( vTarget.toDbgString() );
}
{
var vTarget = VirtualTargets.createNode("PADrendApp (release)");
vTarget += targets["EScript"];
vTarget += targets["Geometry"];
vTarget += targets["Util"];
vTarget += targets["Rendering"];
vTarget += targets["GUI"];
vTarget += targets["Sound"];
vTarget += targets["MinSG"];
vTarget += targets["E_Geometry"];
vTarget += targets["E_Util"];
vTarget += targets["E_Rendering"];
vTarget += targets["E_GUI"];
vTarget += targets["E_Sound"];
vTarget += targets["E_MinSG"];
vTarget += targets["~PADrend"];
targets["PADrendApp(release)"] = vTarget;
// outln( vTarget.toDbgString() );
}
//---------------------------
var project = Projects.createNode( config.get('Project.name',"PADrend") );
CompilerOptions.setCompilerId( project, config.get('Project.compilerId',"gcc") );
CompilerOptions.addOptions( project, config.get('Project.compilerOptions',[
"-std=c++11",
"-pedantic","-Wall","-Wextra","-Wshadow","-Wcast-qual","-Wcast-align","-Wlogical-op",
"-Wredundant-decls","-Wdisabled-optimization","-Wstack-protector","-Winit-self","-Wmissing-include-dirs",
"-Wswitch-default","-Wswitch-enum","-Wctor-dtor-privacy","-Wstrict-null-sentinel","-Wno-non-template-friend",
"-Wold-style-cast","-Woverloaded-virtual","-Wno-pmf-conversions","-Wsign-promo","-Wmissing-declarations"
]));
foreach( targets as var target)
project += target;
// ------------------------------------
outln("-"*10);
outln("Generating Code::Blocks project file...");
var generator = module('EkkiEkkiKateng/CodeBlocksGenerator');
//generator.createProject( project );
IO.saveTextFile(folder_base+"/PADrend.cbp", generator.createProject( project ));
//print_r(project.toDbgString());
// -----------------------------------
}catch(e){
outln(e);
}
if(getOS()=="WINDOWS")
system('pause');
return true;