Skip to content

Instantly share code, notes, and snippets.

@tiomoreno
Created May 24, 2013 17:36
Show Gist options
  • Save tiomoreno/5645160 to your computer and use it in GitHub Desktop.
Save tiomoreno/5645160 to your computer and use it in GitHub Desktop.

C++ Sublime Text Build

This builds single C++ files in Sublime Text, handy for testing small things.

Works With

  • OSX (Assuming xcode installed)
  • Linux (Should work if g++ is installed)
  • Windows (Need CL working)

Thanks to adnansky for Linux Test and Shell update.

{
"cmd": ["g++", "$file", "-o", "$file_base_name", "-I/usr/local/include"],
"selector": "source.c++",
"windows":
{
"cmd": ["cl", "/Fo${file_path}", "/O2", "$file"]
}
}
{
"cmd": ["g++ -Wall ${file} -o ${file_base_name} && ./${file_base_name}"], "working_dir": "${file_path}",
"selector": "source.c++",
"shell": true,
"windows":
{
"cmd": ["cl", "/Fo${file_path}", "/O2", "$file"],
"selector": "source.c++",
"shell": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment