Hi, I was playing around with the C++ build system (C++ Single File.sublime-build) to make it work with MSVC on Windows:
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c++",
"windows": {
"shell_cmd": "vcvars64.bat && cl /Ehsc /Za $file",
},
"variants":
[
{
"name": "Build & Run",
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\"",
"windows": {
"shell_cmd": "vcvars64.bat && cl /Ehsc /Za $file && \"${file_path}/${file_base_name}\"",
},
},
{
"name": "Run",
"shell_cmd": "\"${file_path}/${file_base_name}\""
}
]
}
so now I have 3 build options:
- C++ Single File
- C++ Single File - Build & Run
- C++ Single File - Run
the first two work fine, but the Run variant is not detected and instead the first one (global) is run.
How can I fix this ?
- OS: Windows 7
- ST: 3189