Nightly Build 2197 is out now, with some improvements to build systems. Notably, build system variants are now supported, for example, here’s C++.sublime-build:
{
"cmd": "g++", "${file}", "-o", "${file_path}/${file_base_name}"],
"file_regex": "^(..^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
{
"name": "Run",
"cmd": "bash", "-c", "g++ '${file}' -o '${file_path}/${file_base_name}' && '${file_path}/${file_base_name}'"]
}
]
}
Each variant overrides properties in the build system, and can be selected from the Command Palette when the build system in question is active. If there’s a variant called “Run”, it’ll also show up in the Tools menu, and will be trigged with Ctrl+Shift+B / Cmd+Shift+B.
Additionally, the “build” command now accepts a variant parameter, so you can bind keys to other variants, too.