From 8e6c9ffd28a17bcb81016412b23cffc490f02dab Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 5 Jan 2018 07:54:14 +0100 Subject: Do not generate debug info if building release --- backend/ninja/Ninja.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'backend') 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: -- cgit v1.2.3