Skip to content

Instantly share code, notes, and snippets.

@Tomaszal
Last active November 2, 2017 20:33
Show Gist options
  • Save Tomaszal/2b13ade96d47cd7d0bb4526c6b64efb6 to your computer and use it in GitHub Desktop.
Save Tomaszal/2b13ade96d47cd7d0bb4526c6b64efb6 to your computer and use it in GitHub Desktop.
My C++ Sublime build system config. Prints results in Sublime's shell. Has an option to capture standard streams (pipes contents of file "in" to stdin & pipes stdout to file "out").
{
"selector": "source.cpp",
"file_patterns": ["*.cpp"],
"working_dir": "$file_path",
"shell": true,
"linux":
{
"shell_cmd": "g++ $file_name -o ${file_base_name}.bin && echo | ./${file_base_name}.bin && echo \n"
},
"windows":
{
"shell_cmd": "g++ $file_name -o ${file_base_name}.exe && echo | ${file_base_name}.exe && echo.",
"env":
{
"PATH": "C:/MinGW/bin"
}
},
"variants":
[
{
"name": "Capture standard streams (stdin & stdout)",
"linux":
{
"shell_cmd": "g++ $file_name -o ${file_base_name}.bin && cat in | ./${file_base_name}.bin > out && cat out && echo \n"
},
"windows":
{
"shell_cmd": "g++ $file_name -o ${file_base_name}.exe && type in | ${file_base_name}.exe > out && type out && echo.",
"env":
{
"PATH": "C:/MinGW/bin"
}
}
}
]
}
@Tomaszal
Copy link
Author

Tomaszal commented Nov 2, 2017

This is pretty much a mirror of my C build system, just for C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment