aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-06-27 16:13:58 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-06 07:39:32 +0200
commit5bb7ee28bc4f5a0ee119de46165c507d6db995a3 (patch)
tree42f0c8751dcff69e27f5698f703c0f253d361fa6 /backend
parent02eb206cb76c9efd6cecf9f9493eecfa410d4da3 (diff)
Only show warnings in main project. TODO: Add option to show for dependencies
Diffstat (limited to 'backend')
-rw-r--r--backend/ninja/Ninja.cpp22
1 files changed, 14 insertions, 8 deletions
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<bool>::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<bool> buildResult = compile(savePath);
if (!buildResult)