代码语言:javascript复制
{
// Windows
// build only
"shell_cmd": "g -std=c 14 -g -Wall "${file}" -o "${file_base_name}.exe"",
// doesn't matter if I use full path
"working_dir": "${file_path}",
// only Cpp files can use this sublime-build file
"selector": "source.c ",
"variants": [
{
// build and run in Terminus (sublime plugin)
// [Recommanded]
"name": "Run In Terminus",
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"shell_cmd": "g -std=c 14 -g -Wall "${file}" -o "${file_base_name}.exe" && cmd /c "${file_base_name}.exe""
},
{
// build and run in CMD
// you can type something in CMD then your progam can get its inputs
// [Recommanded]
"name": "Run in CMD",
"shell_cmd": "g -std=c 14 -g -Wall "${file}" -o "${file_base_name}.exe" && start cmd /c ""${file_base_name}.exe" & pause ""
},
{
// build and run in sublime
// but you can't input anything to your progam
"name": "Run in Sublime",
"shell_cmd": "g -std=c 11 -g -Wall "${file}" -o "${file_base_name}.exe" && cmd /c "${file_base_name}.exe""
}
]
}