Skip to content

Instantly share code, notes, and snippets.

@mottosso
Last active January 31, 2022 02:49
Show Gist options
  • Save mottosso/c462d678bb3bf799c9fb to your computer and use it in GitHub Desktop.
Save mottosso/c462d678bb3bf799c9fb to your computer and use it in GitHub Desktop.
Sublime Build System for Clang
// Build System for Sublime Text 3 to compile C using Clang.
//
// Usage:
// Compile and run via CTRL-b or F7
// Compile with CTRL-SHIFT-b
//
// Pre-requisities:
// - A Unix-like OS (for bash)
// - clang must be available on your PATH
//
{
"cmd": ["bash", "-c", "clang '${file}' -Wall -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"],
"selector": "source.c",
"shell": false,
"working_dir": "$file_path",
"variants": [
{
"name": "Run",
"cmd": ["clang", "$file", "-o", "${file_base_name}", "-Wall"]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment