diff options
| -rw-r--r-- | source/core/slang-gcc-compiler-util.cpp | 28 | ||||
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 8 |
2 files changed, 27 insertions, 9 deletions
diff --git a/source/core/slang-gcc-compiler-util.cpp b/source/core/slang-gcc-compiler-util.cpp index 08e45b5c1..3f045aa80 100644 --- a/source/core/slang-gcc-compiler-util.cpp +++ b/source/core/slang-gcc-compiler-util.cpp @@ -134,7 +134,7 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse // Set to default case outLineParseResult = LineParseResult::Ignore; - + /* example error output from different scenarios */ /* @@ -167,11 +167,29 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse /home/travis/build/shader-slang/slang/tests/cpp-compiler/c-compile-link-error.c:10: undefined reference to `thing' clang-7: error: linker command failed with exit code 1 (use -v to see invocation)*/ + /* /path/slang-cpp-prelude.h:4:10: fatal error: ../slang.h: No such file or directory + #include "../slang.h" + ^~~~~~~~~~~~ + compilation terminated.*/ + outDiagnostic.stage = Diagnostic::Stage::Compile; List<UnownedStringSlice> split; StringUtil::split(line, ':', split); + // On windows we can have paths that are a: etc... if we detect this we can combine 0 - 1 to be 1. + if (split.getCount() > 1 && split[0].getLength() == 1) + { + const char c = split[0][0]; + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) + { + // We'll assume it's a path + UnownedStringSlice path(split[0].begin(), split[1].end()); + split.removeAt(0); + split[0] = path; + } + } + if (split.getCount() == 2) { const auto split0 = split[0].trim(); @@ -267,19 +285,21 @@ static SlangResult _parseGCCFamilyLine(const UnownedStringSlice& line, LineParse return SLANG_OK; } } - else if (split.getCount() == 5) + else if (split.getCount() >= 5) { // Probably a regular error line SLANG_RETURN_ON_FAIL(_parseErrorType(split[3].trim(), outDiagnostic.type)); outDiagnostic.filePath = split[0]; SLANG_RETURN_ON_FAIL(StringUtil::parseInt(split[1], outDiagnostic.fileLine)); - outDiagnostic.text = split[4]; + + // Everything from 4 to the end is the error + outDiagnostic.text = UnownedStringSlice(split[4].begin(), split.getLast().end()); outLineParseResult = LineParseResult::Start; return SLANG_OK; } - + // Assume it's a continuation outLineParseResult = LineParseResult::Continuation; return SLANG_OK; diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index 7f394eec5..d72144856 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -3142,11 +3142,9 @@ SlangResult innerMain(int argc, char** argv) { // On TeamCity CI there is an issue with unix/linux targets where test system may be different from the build system // That we rely on having compilation tools present such that on x64 systems we can build x86 binaries, and that appears to - // not be the case. - // Additionally it may be the case that on test systems, they can compile shared libraries but loading and using them does not - // appear to work. Initially it was thought it might be protected against files in /tmp but copying shared libraries elsewhere - // also doesn't work -#if SLANG_UNIX_FAMILY /* && SLANG_PROCESSOR_X86 */ + // not always be the case. + // For now we only allow CPP backends to run on x86_64 targets +#if SLANG_UNIX_FAMILY && !SLANG_PROCESSOR_X86_64 _disableCPPBackends(&context); #endif } |
