Skip to content

Instantly share code, notes, and snippets.

@oskarnp
Last active October 29, 2024 02:07
Show Gist options
  • Save oskarnp/56a5be5722e96b50295f08d9aa33d310 to your computer and use it in GitHub Desktop.
Save oskarnp/56a5be5722e96b50295f08d9aa33d310 to your computer and use it in GitHub Desktop.
Sublime build system for Odin
{
"selector":"source.odin",
"file_regex": "^(.+)\\(([0-9]+):([0-9]+)\\) (.+)$",
"shell_cmd":"odin check \"$file_path\" -no-entry-point",
"variants":[
//
// current file
//
// syntax check
{ "name":"current file - syntax check", "shell_cmd":"odin check \"$file\" -file -no-entry-point" },
// run
{ "name":"current file - run (debug, o:minimal)", "shell_cmd":"odin run \"$file\" -file -o:minimal -debug" },
{ "name":"current file - run (o:size)", "shell_cmd":"odin run \"$file\" -file -o:size" },
{ "name":"current file - run (o:size, no-bounds-check)", "shell_cmd":"odin run \"$file\" -file -o:size -no-bounds-check" },
{ "name":"current file - run (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin run \"$file\" -file -o:size -no-bounds-check -disable-assert" },
{ "name":"current file - run (o:size, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin run \"$file\" -file -o:size -no-bounds-check -disable-assert -microarch:native" },
{ "name":"current file - run (o:speed)", "shell_cmd":"odin run \"$file\" -file -o:speed" },
{ "name":"current file - run (o:speed, no-bounds-check)", "shell_cmd":"odin run \"$file\" -file -o:speed -no-bounds-check" },
{ "name":"current file - run (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin run \"$file\" -file -o:speed -no-bounds-check -disable-assert" },
{ "name":"current file - run (o:speed, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin run \"$file\" -file -o:speed -no-bounds-check -disable-assert -microarch:native" },
// test
{ "name":"current file - test (debug, o:minimal)", "shell_cmd":"odin test \"$file\" -file -o:minimal -debug" },
{ "name":"current file - test (o:size)", "shell_cmd":"odin test \"$file\" -file -o:size" },
{ "name":"current file - test (o:size, no-bounds-check)", "shell_cmd":"odin test \"$file\" -file -o:size -no-bounds-check" },
{ "name":"current file - test (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin test \"$file\" -file -o:size -no-bounds-check -disable-assert" },
{ "name":"current file - test (o:size, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin test \"$file\" -file -o:size -no-bounds-check -disable-assert -microarch:native" },
{ "name":"current file - test (o:speed)", "shell_cmd":"odin test \"$file\" -file -o:speed" },
{ "name":"current file - test (o:speed, no-bounds-check)", "shell_cmd":"odin test \"$file\" -file -o:speed -no-bounds-check" },
{ "name":"current file - test (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin test \"$file\" -file -o:speed -no-bounds-check -disable-assert" },
{ "name":"current file - test (o:speed, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin test \"$file\" -file -o:speed -no-bounds-check -disable-assert -microarch:native" },
// build asm
{ "name":"current file - build asm (debug, o:minimal)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:minimal -debug" },
{ "name":"current file - build asm (o:size)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:size" },
{ "name":"current file - build asm (o:size, no-bounds-check)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:size -no-bounds-check" },
{ "name":"current file - build asm (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:size -no-bounds-check -disable-assert" },
{ "name":"current file - build asm (o:size, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:size -no-bounds-check -disable-assert -microarch:native" },
{ "name":"current file - build asm (o:speed)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:speed" },
{ "name":"current file - build asm (o:speed, no-bounds-check)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:speed -no-bounds-check" },
{ "name":"current file - build asm (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:speed -no-bounds-check -disable-assert" },
{ "name":"current file - build asm (o:speed, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin build \"$file\" -file -build-mode:asm -o:speed -no-bounds-check -disable-assert -microarch:native" },
// build llvm-ir
{ "name":"current file - build llvm-ir (debug, o:minimal)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:minimal -debug" },
{ "name":"current file - build llvm-ir (o:size)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:size" },
{ "name":"current file - build llvm-ir (o:size, no-bounds-check)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:size -no-bounds-check" },
{ "name":"current file - build llvm-ir (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:size -no-bounds-check -disable-assert" },
{ "name":"current file - build llvm-ir (o:speed)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:speed" },
{ "name":"current file - build llvm-ir (o:speed, no-bounds-check)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:speed -no-bounds-check" },
{ "name":"current file - build llvm-ir (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file\" -file -build-mode:llvm-ir -o:speed -no-bounds-check -disable-assert" },
//
// current package
//
// syntax check
{ "name":"current package - syntax check", "shell_cmd":"odin check \"$file_path\" -no-entry-point" },
// run
{ "name":"current package - run (debug, o:minimal)", "shell_cmd":"odin run \"$file_path\" -o:minimal -debug" },
{ "name":"current package - run (o:size)", "shell_cmd":"odin run \"$file_path\" -o:size" },
{ "name":"current package - run (o:size, no-bounds-check)", "shell_cmd":"odin run \"$file_path\" -o:size -no-bounds-check" },
{ "name":"current package - run (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin run \"$file_path\" -o:size -no-bounds-check -disable-assert" },
{ "name":"current package - run (o:size, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin run \"$file_path\" -o:size -no-bounds-check -disable-assert -microarch:native" },
{ "name":"current package - run (o:speed)", "shell_cmd":"odin run \"$file_path\" -o:speed" },
{ "name":"current package - run (o:speed, no-bounds-check)", "shell_cmd":"odin run \"$file_path\" -o:speed -no-bounds-check" },
{ "name":"current package - run (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin run \"$file_path\" -o:speed -no-bounds-check -disable-assert" },
{ "name":"current package - run (o:speed, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin run \"$file_path\" -o:speed -no-bounds-check -disable-assert -microarch:native" },
// test
{ "name":"current package - test (debug, o:minimal)", "shell_cmd":"odin test \"$file_path\" -o:minimal -debug" },
{ "name":"current package - test (o:size)", "shell_cmd":"odin test \"$file_path\" -o:size" },
{ "name":"current package - test (o:size, no-bounds-check)", "shell_cmd":"odin test \"$file_path\" -o:size -no-bounds-check" },
{ "name":"current package - test (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin test \"$file_path\" -o:size -no-bounds-check -disable-assert" },
{ "name":"current package - test (o:size, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin test \"$file_path\" -o:size -no-bounds-check -disable-assert -microarch:native" },
{ "name":"current package - test (o:speed)", "shell_cmd":"odin test \"$file_path\" -o:speed" },
{ "name":"current package - test (o:speed, no-bounds-check)", "shell_cmd":"odin test \"$file_path\" -o:speed -no-bounds-check" },
{ "name":"current package - test (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin test \"$file_path\" -o:speed -no-bounds-check -disable-assert" },
{ "name":"current package - test (o:speed, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin test \"$file_path\" -o:speed -no-bounds-check -disable-assert -microarch:native" },
// build asm
{ "name":"current package - build asm (debug, o:minimal)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:minimal -debug" },
{ "name":"current package - build asm (o:size)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:size" },
{ "name":"current package - build asm (o:size, no-bounds-check)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:size -no-bounds-check" },
{ "name":"current package - build asm (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:size -no-bounds-check -disable-assert" },
{ "name":"current package - build asm (o:size, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:size -no-bounds-check -disable-assert -microarch:native" },
{ "name":"current package - build asm (o:speed)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:speed" },
{ "name":"current package - build asm (o:speed, no-bounds-check)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:speed -no-bounds-check" },
{ "name":"current package - build asm (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:speed -no-bounds-check -disable-assert" },
{ "name":"current package - build asm (o:speed, no-bounds-check, disable-assert, microarch:native)", "shell_cmd":"odin build \"$file_path\" -build-mode:asm -o:speed -no-bounds-check -disable-assert -microarch:native" },
// build llvm-ir
{ "name":"current package - build llvm-ir (debug, o:minimal)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:minimal -debug" },
{ "name":"current package - build llvm-ir (o:size)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:size" },
{ "name":"current package - build llvm-ir (o:size, no-bounds-check)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:size -no-bounds-check" },
{ "name":"current package - build llvm-ir (o:size, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:size -no-bounds-check -disable-assert" },
{ "name":"current package - build llvm-ir (o:speed)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:speed" },
{ "name":"current package - build llvm-ir (o:speed, no-bounds-check)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:speed -no-bounds-check" },
{ "name":"current package - build llvm-ir (o:speed, no-bounds-check, disable-assert)", "shell_cmd":"odin build \"$file_path\" -build-mode:llvm-ir -o:speed -no-bounds-check -disable-assert" },
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment