aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-05 07:54:14 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-05 07:54:19 +0100
commit8e6c9ffd28a17bcb81016412b23cffc490f02dab (patch)
tree84ecec7ec6e7cfde1fb33dc134ee02e3deb20cba
parentcf160bdab6595e9888f23bf9df0cf03613068240 (diff)
Do not generate debug info if building release
-rw-r--r--backend/ninja/Ninja.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp
index 50cd577..9dd3ecc 100644
--- a/backend/ninja/Ninja.cpp
+++ b/backend/ninja/Ninja.cpp
@@ -597,7 +597,16 @@ namespace backend
case Compiler::GCC:
{
// -Werror
- result += " '-I" + config.getPackageName() + "@exe' " + cflags + " '-I..' -Wall -Wextra -Werror=return-type -fexceptions -fdiagnostics-show-option '-fdiagnostics-color=always' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Winvalid-pch' '-Wnon-virtual-dtor' " + optimizationFlags + " '-g'";
+ result += " '-I" + config.getPackageName() + "@exe' " + cflags + " '-I..' -Wall -Wextra -Werror=return-type -fexceptions -fdiagnostics-show-option '-fdiagnostics-color=always' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Winvalid-pch' '-Wnon-virtual-dtor' " + optimizationFlags;
+ switch (config.getOptimizationLevel())
+ {
+ case OPT_LEV_DEBUG:
+ result += " -g3";
+ break;
+ case OPT_LEV_RELEASE:
+ result += " -g0";
+ break;
+ }
break;
}
case Compiler::MSVC: