-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.jai
51 lines (40 loc) · 1.17 KB
/
build.jai
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
#import "Basic";
#import "Compiler";
#import "unotest";
build :: ()
{
set_build_options_dc( .{do_output=false} ); // No executable for this workspace.
global_options := get_build_options();
global_options.output_path = "bin";
global_options.intermediate_path = "bin";
build_release := false;
args := global_options.compile_time_command_line;
// NOTE These arguments have to be specified last, after any arguments for the compiler itself, separated with a hyphen, e.g:
// jai build.jai - release
for arg: args
{
if arg ==
{
case "--release"; #through;
case "-release"; #through;
case "release";
build_release = true;
print( "Building release version.\n" );
}
}
if build_release
{
set_optimization( *global_options, .VERY_OPTIMIZED, true );
global_options.backend =.LLVM;
}
else
{
set_optimization( *global_options, .DEBUG, true );
global_options.backend =.X64;
}
// Test executable
{
w := BuildTestWorkspace( "Tests", global_options, .[ "tests/test.jai" ] );
}
}
#run build();