-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforge.lua
73 lines (64 loc) · 2.02 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
73
local paths = {
package.path;
root( 'lalr/src/lalr/?.lua' );
root( 'lalr/src/lalr/?/init.lua' );
};
package.path = table.concat( paths, ";" );
variant = lower( variant or 'debug' );
local forge = require( 'forge' ):load( variant );
local cc = forge.Toolset 'cc_${platform}_${architecture}' {
platform = operating_system();
bin = root( ('%s/bin'):format(variant) );
lib = root( ('%s/lib'):format(variant) );
obj = root( ('%s/obj'):format(variant) );
include_directories = {
root();
root( 'lalr/src' );
root( 'unittest-cpp' );
};
library_directories = {
root( ("%s/lib"):format(variant) );
};
defines = {
('BUILD_OS_%s'):format( upper(operating_system()) );
('BUILD_VARIANT_%s'):format( upper(variant) );
};
zero_brane_studio = {
mobdebug = mobdebug;
};
architecture = 'native';
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';
lua_mobdebug_enabled = variant ~= 'shipping';
minimal_rebuild = variant == 'debug';
optimization = variant ~= 'debug';
persist_test_enabled = true;
run_time_checks = variant == 'debug';
runtime_library = variant == 'debug' and 'static_debug' or 'static_release';
run_time_type_info = true;
standard = 'c++17';
string_pooling = variant == 'shipping';
strip = false;
unit_tests_enabled = true;
warning_level = 3;
warnings_as_errors = true;
};
if variant == 'debug' then
table.insert( cc.defines, '_DEBUG' );
elseif variant == 'shipping' then
table.insert( cc.defines, 'NDEBUG' );
end
cc:install( 'forge.cc' );
cc:install( 'forge.lalr' );
cc:all {
'persist/persist_examples/all';
'persist/persist_test/all';
};
buildfile 'lalr/lalr.forge';
buildfile 'persist.forge';
buildfile 'unittest-cpp/unittest-cpp.forge';