-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.jai
42 lines (32 loc) · 1.15 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
#import "Basic"()(MEMORY_DEBUGGER=true);
#import "Compiler";
#import "String";
#load "src/notes.jai";
#load "src/jai-spec/run.jai";
#run {
target_workspace := compiler_create_workspace("jai-record");
if !target_workspace {
print("Workspace creation failed.\n");
return;
}
target_workspace_options := get_build_options();
target_workspace_options.output_type = .NO_OUTPUT;
target_workspace_options.output_executable_name = "jai-record";
import_path: [..] string;
array_add(*import_path, ..target_workspace_options.import_path);
array_add(*import_path, "./vendor", "./src");
target_workspace_options.import_path = import_path;
set_build_options(target_workspace_options, target_workspace);
specs_run(target_workspace);
compiler_begin_intercept(target_workspace);
add_build_file("src/main.jai", target_workspace);
while true {
message := compiler_wait_for_message();
if !message break;
if message.kind == .COMPLETE break;
}
compiler_end_intercept(target_workspace);
build_workspace_options := get_build_options();
build_workspace_options.output_type = .NO_OUTPUT;
set_build_options(build_workspace_options);
};