jai build.jai && module_test.exe
mod_a func (do_thing=false) is at procedure 0x7ff671b2f290
mod_a func (do_thing=false) is at procedure 0x7ff671b2f290
| #scope_file | |
| module_search_paths := string.[ | |
| ".", | |
| ]; | |
| build :: () { | |
| set_working_directory(#filepath); | |
| opts := get_build_options(); | |
| opts.output_type = .NO_OUTPUT; | |
| set_build_options(opts); | |
| w := compiler_create_workspace("build"); | |
| { | |
| compiler_begin_intercept(w); | |
| defer compiler_end_intercept(w); | |
| array_add(*opts.modules_search_path_array, ..module_search_paths); | |
| opts.output_type = .EXECUTABLE; | |
| opts.output_executable_name = "module_test.exe"; | |
| set_build_options(opts, w); | |
| add_build_file("module_test.jai", w); | |
| while true { | |
| message := compiler_wait_for_message(); | |
| if !message || message.workspace != w continue; | |
| if message.kind == .COMPLETE { break; } | |
| } | |
| } | |
| }; | |
| #run build(); | |
| #import "Basic"; | |
| #import "Compiler"; |
| #module_parameters(do_thing: bool); | |
| print_where_storage_is :: () { | |
| print("mod_a func (do_thing=%) is at %\n", do_thing, print_where_storage_is); | |
| } | |
| #scope_file | |
| #import "Basic"; |
| main :: () { | |
| A :: #import "mod_a"(do_thing=true); | |
| B :: #import "mod_a"(do_thing=false); | |
| A.print_where_storage_is(); | |
| B.print_where_storage_is(); | |
| } | |
| #scope_file | |
| #import "Basic"; |