diff options
Diffstat (limited to 'source/compiler-core/slang-gcc-compiler-util.cpp')
| -rw-r--r-- | source/compiler-core/slang-gcc-compiler-util.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/compiler-core/slang-gcc-compiler-util.cpp b/source/compiler-core/slang-gcc-compiler-util.cpp index 79aefc71d..2bcdfcbfa 100644 --- a/source/compiler-core/slang-gcc-compiler-util.cpp +++ b/source/compiler-core/slang-gcc-compiler-util.cpp @@ -107,12 +107,15 @@ SlangResult GCCDownstreamCompilerUtil::calcVersion(const ExecutableLocation& exe UnownedStringSlice::fromLiteral("clang version"), UnownedStringSlice::fromLiteral("gcc version"), UnownedStringSlice::fromLiteral("Apple LLVM version"), + UnownedStringSlice::fromLiteral("Apple metal version"), + }; const SlangPassThrough types[] = { SLANG_PASS_THROUGH_CLANG, SLANG_PASS_THROUGH_GCC, SLANG_PASS_THROUGH_CLANG, + SLANG_PASS_THROUGH_METAL, }; SLANG_COMPILE_TIME_ASSERT(SLANG_COUNT_OF(prefixes) == SLANG_COUNT_OF(types)); @@ -262,8 +265,9 @@ static SlangResult _parseGCCFamilyLine(SliceAllocator& allocator, const UnownedS const auto split1 = split[1].trim(); const auto text = split[2].trim(); - // Check for special handling for clang (Can be Clang or clang apparently) + // Check for special handling for clang or metal if (split0.startsWith(UnownedStringSlice::fromLiteral("clang")) || + split0.startsWith(UnownedStringSlice::fromLiteral("metal")) || split0.startsWith(UnownedStringSlice::fromLiteral("Clang")) || split0 == UnownedStringSlice::fromLiteral("g++") || split0 == UnownedStringSlice::fromLiteral("gcc")) @@ -469,6 +473,11 @@ static SlangResult _parseGCCFamilyLine(SliceAllocator& allocator, const UnownedS // C++17 since we share headers with slang itself (which uses c++17) cmdLine.addArg("-std=c++17"); } + + if (targetDesc.payload == ArtifactDesc::Payload::MetalAIR) + { + cmdLine.addArg("-std=macos-metal2.3"); + } // Our generated code very often casts between dissimilar types with the // knowledge that they have the same representation. This is strictly |
