Logo

index : blog

---

  • summary
  • about
  • tree
  • log
  • branches
<< path: root/public/blog.git/html/modules/uniform/first.jai blob: beee2aa05a75544a8da9289b1f1fb260f73a6fc1 [raw] [clear marker]

        
0#load "modules/stubborn/run.jai";
1
2#run {
3 options := get_build_options();
4 args := options.compile_time_command_line;
5
6 entrypoint := ifx args.count then args[0] else "";
7 if entrypoint == "test" {
8 test_args := args;
9 test_args.data += 1;
10 test_args.count -= 1;
11
12 base_path := path_strip_filename(#filepath);
13
14 build_tests(options, "tests", tprint(#string END
15 #load "%/module.jai";
16 // #load "char_class.jai";
17 // #load "rune.jai";
18 END, base_path), get_absolute_path("./modules"), args = test_args, run = true);
19 } else {
20 build("module.jai", .NO_OUTPUT);
21 }
22}
23
24build :: (filename: string, output_type: type_of(Build_Options.output_type) = .EXECUTABLE, executable := "") {
25 set_build_options_dc(.{do_output = false});
26
27 w := compiler_create_workspace(tprint("Compile %", filename));
28 build_options := get_build_options(w);
29 build_options.output_type = output_type;
30 build_options.output_executable_name = ifx executable then executable else basename(filename);
31 // build_options.backend = .X64;
32 // build_options.optimization_level = Optimization_Level.RELEASE;
33
34 // llvm_args: [..] string;
35 // array_add(*llvm_args, "-fasdgasgsanitize=address");
36 // build_options.llvm_options.debug_options = llvm_args;
37 import_path: [..] string;
38 array_add(*import_path, .. build_options.import_path);
39 array_add(*import_path, "modules");
40 build_options.import_path = import_path;
41 set_build_options(build_options, w);
42
43 add_build_file(filename, w);
44}
45
46#scope_file
47
48#import "Basic";
49#import "Compiler";
50#import "String";
51
52
Copyright 2026  E766CB298A6D1E64 | Git-Thing heavily inspired by cgit