Skip to content

Commit 72678a8

Browse files
Capture compile warnings if any
1 parent 115401d commit 72678a8

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

DefaultYAMLs/DefaultUserConfig.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# List of anchors that will be aliased later
22
Templates:
33
MSVC_CompileFlags: &MSVC_CompileFlags
4-
Flags: "/NOLOGO /W3 /WX /diagnostics:caret /D NDEBUG /utf-8 /Gm- /MD /EHa /TP /std:c++17 /GR /TP"
4+
Flags: "/NOLOGO /W4 /diagnostics:caret /D NDEBUG /utf-8 /Gm- /MD /EHa /TP /std:c++17 /GR /TP"
55

66
"g++_CompileRunParts": &g++_CompileRunParts
77
- Type: Once
@@ -164,7 +164,7 @@ Profiles:
164164
CompileTypes:
165165
Executable:
166166
Default:
167-
Flags: "-std=c++17 -Wall -Werror"
167+
Flags: "-std=c++17 -Wall"
168168
Executable: "g++"
169169
RunParts: *g++_CompileRunParts
170170
# (Optional) The commands to run in **shell** BEFORE compiling
@@ -175,14 +175,14 @@ Profiles:
175175
# Cleanup: []
176176
Static:
177177
Default:
178-
Flags: "-std=c++17 -Wall -Werror"
178+
Flags: "-std=c++17 -Wall"
179179
Executable: "g++"
180180
RunParts: *g++_CompileRunParts
181181
# Setup: []
182182
# Cleanup: []
183183
Shared:
184184
Default:
185-
Flags: "-std=c++17 -Wall -Werror -fpic"
185+
Flags: "-std=c++17 -Wall -fpic"
186186
Executable: "g++"
187187
RunParts: *g++_CompileRunParts
188188
# Setup: []

Examples/test.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,26 @@
4545
Default:
4646
"Default":
4747
- "./Include/ssLogger/ssLog.hpp"
48+
49+
- Name: System2.cpp
50+
Platforms: [Default]
51+
Source:
52+
Type: Git
53+
Value: "https://github.com/Neko-Box-Coder/System2.cpp.git"
54+
LibraryType: Header
55+
IncludePaths: ["./", "./External/System2"]
56+
Setup:
57+
Default:
58+
"Default":
59+
- "git submodule update --init --recursive"
4860
*/
4961

5062

5163
//#include "ssLogger/ssLogInit.hpp"
5264

5365
#define ssLOG_DLL 1
5466
#include "ssLogger/ssLog.hpp"
67+
#include "System2.hpp"
5568

5669
#if defined(__GNUC__)
5770
#include "./OtherSources/AnotherSourceFileGcc.hpp"
@@ -69,6 +82,16 @@ int main(int argc, char* argv[])
6982
std::cout << "Hello World" << std::endl;
7083
std::cout << TEST_DEF << std::endl;
7184

85+
System2CommandInfo commandInfo = {};
86+
int returnCode = 0;
87+
88+
#if defined(_WIN32)
89+
System2CppRun("dir", commandInfo);
90+
#else
91+
auto re = System2CppRun("ls -lah", commandInfo);
92+
#endif
93+
System2CppGetCommandReturnValueSync(commandInfo, returnCode);
94+
7295
for(int i = 0; i < argc; ++i)
7396
std::cout << "Arg" << i << ": " << argv[i] << std::endl;
7497

Src/runcpp2/CompilingLinking.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ namespace
292292
ssLOG_ERROR("Compile output: \n" << commandOutput);
293293
return false;
294294
}
295+
else
296+
{
297+
//TODO: Make this configurable
298+
//Attempt to capture warnings
299+
if(commandOutput.find(" warning") != std::string::npos)
300+
ssLOG_WARNING("Warning detected:\n" << commandOutput);
301+
else
302+
ssLOG_INFO("Compile output:\n" << commandOutput);
303+
}
295304
}
296305

297306
//Run cleanup if any
@@ -581,6 +590,8 @@ namespace
581590
ssLOG_ERROR("Link output: \n" << linkOutput);
582591
return false;
583592
}
593+
else
594+
ssLOG_INFO("Link output:\n" << linkOutput);
584595
}
585596

586597
//Run cleanup if any

0 commit comments

Comments
 (0)