audioplayer/build.jai
2026-05-04 19:50:59 +03:00

51 lines
1.4 KiB
Plaintext

//
// Build metaprogram for the jellyfin music player.
//
// Run with: jai build.jai
//
// Adds ./modules to the import path so we can vendor Jaison alongside the
// standard Jai modules.
//
#run build();
build :: () {
set_build_options_dc(.{do_output = false});
w := compiler_create_workspace("Player");
if !w {
compiler_report("Could not create workspace.");
return;
}
options := get_build_options(w);
copy_commonly_propagated_fields(get_build_options(), *options);
options.output_executable_name = "player";
options.output_path = "build/";
import_paths: [..] string;
array_add(*import_paths, tprint("%modules", #filepath));
for options.import_path array_add(*import_paths, it);
options.import_path = import_paths;
// Help the linker find libcurl.so. On a system where only libcurl.so.4 is
// installed (no -dev package), we fall back to a symlink in ./lib/.
extra_linker: [..] string;
array_add(*extra_linker, tprint("-L%lib", #filepath));
options.additional_linker_arguments = extra_linker;
set_build_options(options, w);
make_directory_if_it_does_not_exist("build");
compiler_begin_intercept(w);
add_build_file(tprint("%src/main.jai", #filepath), w);
compiler_end_intercept(w);
}
#import "Basic";
#import "Compiler";
#import "File";
#import "File_Utilities";