From 5bb7ee28bc4f5a0ee119de46165c507d6db995a3 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 27 Jun 2018 16:13:58 +0200 Subject: Only show warnings in main project. TODO: Add option to show for dependencies --- backend/ninja/Ninja.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'backend/ninja/Ninja.cpp') diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index ec6a237..59e8486 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -219,7 +219,7 @@ namespace backend if(filepath && !containsSourceFile(filePathStr)) { sourceFiles.emplace_back(filePathStr); - printf("Adding source file: %s\n", filepath); + //printf("Adding source file: %s\n", filepath); } } @@ -229,7 +229,7 @@ namespace backend if(dir && !containsTestSourceDir(dirStr)) { testSourceDirs.emplace_back(dirStr); - printf("Adding test source directory: %s\n", dir); + //printf("Using test source directory: %s\n", dir); } } @@ -361,7 +361,6 @@ namespace backend if(!buildResult) return buildResult; } - return Result::Ok(true); } @@ -715,11 +714,14 @@ namespace backend // -Werror // TODO: Find equivalent -MMD -MP for other compilers than gcc. MMD is used to create "dependency files" -> if headers are modified then source files will be recompiled // when compiling next time... - result += " -fpie -MMD -MP '-I" + config.getPackageName() + "@exe' " + cflags + " '-I..' -Wall -Wextra -Werror=return-type -fdiagnostics-show-option '-fdiagnostics-color=always' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Winvalid-pch' -fstack-protector " + optimizationFlags; + result += " -fpie -MMD -MP '-I" + config.getPackageName() + "@exe' " + cflags + " '-I..'"; + if(config.showWarnings) + result += " -Wall -Wextra -Werror=return-type"; + else + result += " -w"; + result += " -fdiagnostics-show-option '-fdiagnostics-color=always' '-pipe' '-D_FILE_OFFSET_BITS=64' '-Winvalid-pch' -fstack-protector " + optimizationFlags; if(sourceFileLanguage == SourceFileLanguage::CPP) - { result += " -fexceptions -Wnon-virtual-dtor"; - } switch (config.getOptimizationLevel()) { @@ -741,7 +743,11 @@ namespace backend { result += " "; result += optimizationFlags; - result += " /EHsc /W3 "; + result += " /EHs"; + if(config.showWarnings) + result += "/Wall "; + else + result += "/w "; result += cflags; switch (config.getOptimizationLevel()) { @@ -903,7 +909,7 @@ namespace backend if (fileOverwriteResult.isErr()) return fileOverwriteResult; - nprintf(TINYDIR_STRING("Created ninja build file: %s\n"), ninjaBuildFilePath.c_str()); + //nprintf(TINYDIR_STRING("Created ninja build file: %s\n"), ninjaBuildFilePath.c_str()); Result buildResult = compile(savePath); if (!buildResult) -- cgit v1.2.3