Skip to content

Instantly share code, notes, and snippets.

@dniku
Last active August 3, 2017 13:29
Show Gist options
  • Save dniku/09bb075e94ac3ce96d1df8d532ef29e7 to your computer and use it in GitHub Desktop.
Save dniku/09bb075e94ac3ce96d1df8d532ef29e7 to your computer and use it in GitHub Desktop.
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Compile with compile-time checks only",
"shell_cmd": "g++ -DDEV -Wall -Wextra -pedantic -std=c++14 -O2 -Wshadow -Wformat=2 -Wfloat-equal -Wconversion -Wlogical-op -Wcast-qual -Wcast-align \"${file}\" -o \"${file_path}/${file_base_name}\""
},
{
"name": "Compile with compile-time and runtime checks",
"shell_cmd": "g++ -DDEV -Wall -Wextra -pedantic -std=c++14 -O2 -Wshadow -Wformat=2 -Wfloat-equal -Wconversion -Wlogical-op -Wcast-qual -Wcast-align -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_FORTIFY_SOURCE=2 -fsanitize=address -fsanitize=undefined -fno-sanitize-recover -fstack-protector \"${file}\" -o \"${file_path}/${file_base_name}\""
},
{
"name": "Run with compile-time and runtime checks",
"shell_cmd": "g++ -DDEV -Wall -Wextra -pedantic -std=c++14 -O2 -Wshadow -Wformat=2 -Wfloat-equal -Wconversion -Wlogical-op -Wcast-qual -Wcast-align -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_FORTIFY_SOURCE=2 -fsanitize=address -fsanitize=undefined -fno-sanitize-recover -fstack-protector \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
},
{
"name": "Run with compile-time checks only",
"shell_cmd": "g++ -DDEV -Wall -Wextra -pedantic -std=c++14 -O2 -Wshadow -Wformat=2 -Wfloat-equal -Wconversion -Wlogical-op -Wcast-qual -Wcast-align \"${file}\" -o \"${file_path}/${file_base_name}\" && \"${file_path}/${file_base_name}\""
},
{
"name": "Compile with compile-time checks only [no -DDEV]",
"shell_cmd": "g++ -Wall -Wextra -pedantic -std=c++14 -O2 -Wshadow -Wformat=2 -Wfloat-equal -Wconversion -Wlogical-op -Wcast-qual -Wcast-align \"${file}\" -o \"${file_path}/${file_base_name}\""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment