From dc493d492d4d9c090dab410a0cb80eca490c32aa Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 14 Aug 2019 12:57:33 -0400 Subject: 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 --- source/core/slang-gcc-compiler-util.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'source/core') 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"); } -- cgit v1.2.3