Skip to content

Instantly share code, notes, and snippets.

@Liudx1985
Created September 3, 2014 02:37
Show Gist options
  • Save Liudx1985/c27a3526e7fafe13e9ba to your computer and use it in GitHub Desktop.
Save Liudx1985/c27a3526e7fafe13e9ba to your computer and use it in GitHub Desktop.
C++.sublime-build for ST3
{
"cmd": ["g++", "-std=c++1y", "${file}", "-O2", "-Wall", "-o", "${file_path}/${file_base_name}"], // For GCC On Windows and Linux
//"cmd": ["CL", "/Fo${file_base_name}", "/O2", "${file}"], // For CL on Windows Only
"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}'"] // Linux Only
"cmd": ["CMD", "/U", "/C", "g++ -std=c++1y ${file} -O2 -Wall -o ${file_base_name} && ${file_base_name}"] // For GCC On Windows Only
//"cmd": ["CMD", "/U", "/C", "CL /Fo${file_base_name} /O2 ${file} && ${file_base_name}"] // For CL On Windows Only
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment