-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathforge.lua
72 lines (64 loc) · 2.12 KB
/
forge.lua
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
local paths = {
package.path;
root( 'src/lalr/src/lalr/?.lua' );
root( 'src/lalr/src/lalr/?/init.lua' );
};
package.path = table.concat( paths, ';' );
variant = lower( variant or 'debug' );
version = version or ('%s %s %s'):format( os.date('%Y.%m.%d %H:%M:%S'), platform, variant );
local forge = require( 'forge' ):load( variant );
local cc = forge.Toolset 'cc_${platform}' {
platform = operating_system();
bin = root( ('%s/bin'):format(variant) );
lib = root( ('%s/lib'):format(variant) );
obj = root( ('%s/obj'):format(variant) );
include_directories = {
root( 'src' );
root( 'src/zlib' );
root( 'src/libpng' );
root( 'src/unittest-cpp' );
root( 'src/lalr/src' );
};
library_directories = {
root( ("%s/lib"):format(variant) ),
};
defines = {
'WIN32_LEAN_AND_MEAN';
'_CRT_SECURE_NO_DEPRECATE';
'_SCL_SECURE_NO_DEPRECATE';
'NOMINMAX';
};
assertions = variant ~= 'shipping';
debug = variant ~= 'shipping';
debuggable = variant ~= 'shipping';
exceptions = true;
fast_floating_point = variant ~= 'debug';
incremental_linking = variant == 'debug';
link_time_code_generation = variant == 'shipping';
minimal_rebuild = variant == 'debug';
optimization = variant ~= 'debug';
run_time_checks = variant == 'debug';
runtime_library = variant == 'debug' and 'static_debug' or 'static_release';
run_time_type_info = true;
stack_size = 1048576;
standard = 'c++17';
string_pooling = variant == 'shipping';
strip = false;
warning_level = 3;
warnings_as_errors = true;
};
cc:install( 'forge.cc' );
cc:install( 'forge.lalr' );
buildfile 'src/jpeg/jpeg.forge';
buildfile 'src/lalr/lalr.forge';
buildfile 'src/libpng/libpng.forge';
buildfile 'src/math/math.forge';
buildfile 'src/reyes/reyes.forge';
buildfile 'src/unittest-cpp/unittest-cpp.forge';
buildfile 'src/zlib/zlib.forge';
cc:all {
'src/lalr/all',
'src/reyes/all',
'src/reyes/reyes_examples/all',
'src/reyes/reyes_test/all'
};