Skip to content

Instantly share code, notes, and snippets.

@shikharbhardwaj
Created January 20, 2020 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shikharbhardwaj/8200c3c2d549f1d1eadecdaef8b89662 to your computer and use it in GitHub Desktop.
Save shikharbhardwaj/8200c3c2d549f1d1eadecdaef8b89662 to your computer and use it in GitHub Desktop.
Build system for competitive programming
{
"shell_cmd": "g++ \"${file}\" -std=c++1y -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run with optimizations",
"shell_cmd": "g++ -std=c++14 -O2 -Wshadow -Wall -Wno-unused-result \"${file}\" -o \"${file_path}/${file_base_name}\" && timeout 5 \"${file_path}/${file_base_name}\""
},
{
"name": "Run with diagnostics",
"shell_cmd": "g++ -std=c++14 -O2 -g -fsanitize=address -fsanitize=undefined -D_GLIBCXX_DEBUG \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment