diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-08-14 12:57:33 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-08-14 09:57:33 -0700 |
| commit | dc493d492d4d9c090dab410a0cb80eca490c32aa (patch) | |
| tree | f0de85ae64d53afd9b9144df23d2450436565d20 /source/core | |
| parent | ea200663ffe33d7b4c739c0d84e9c21a3ae2ffa6 (diff) | |
Small improvements around C/C++ testing (#1017)
* * Simplify some of test code around CPPCompiler
* Test using 'callable' with pass-through
* Small cpu doc improvements
* Improvements to Clang output parsing.
* Remove temporary file (base filename) .
* Improve handling of external errors - handle severity.
* On error dumping out to 'actual' file for runCPPCompilerCompile.
* Small fixes.
Set the source language type correctly for pass thru.
* Remove warning for test for clang backend c
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-gcc-compiler-util.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/source/core/slang-gcc-compiler-util.cpp b/source/core/slang-gcc-compiler-util.cpp index c48e779d1..b7cc85cb3 100644 --- a/source/core/slang-gcc-compiler-util.cpp +++ b/source/core/slang-gcc-compiler-util.cpp @@ -184,6 +184,16 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse outLineParseResult = LineParseResult::Start; return SLANG_OK; } + + if (SLANG_SUCCEEDED(_parseErrorType(split0, outMsg.type))) + { + // Command line errors can be just contain 'error:' etc. Can be seen on apple/clang + outMsg.stage = OutputMessage::Stage::Compile; + outMsg.text = split[1].trim(); + outLineParseResult = LineParseResult::Single; + return SLANG_OK; + } + outLineParseResult = LineParseResult::Ignore; return SLANG_OK; } @@ -193,8 +203,9 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse const auto split1 = split[1].trim(); const auto text = split[2].trim(); - // Check for special handling for clang - if (split0.startsWith(UnownedStringSlice::fromLiteral("clang"))) + // Check for special handling for clang (Can be Clang or clang apparently) + if (split0.startsWith(UnownedStringSlice::fromLiteral("clang")) || + split0.startsWith(UnownedStringSlice::fromLiteral("Clang")) ) { // Extract the type SLANG_RETURN_ON_FAIL(_parseErrorType(split[1].trim(), outMsg.type)); @@ -387,11 +398,11 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse /* static */SlangResult GCCCompilerUtil::calcArgs(const CompileOptions& options, CommandLine& cmdLine) { PlatformKind platformKind = (options.platform == PlatformKind::Unknown) ? PlatformUtil::getPlatformKind() : options.platform; - - cmdLine.addArg("-fvisibility=hidden"); - + if (options.sourceType == SourceType::CPP) { + cmdLine.addArg("-fvisibility=hidden"); + // Need C++14 for partial specialization cmdLine.addArg("-std=c++14"); } |
