Skip to content

Commit b4367d0

Browse files
committed
Fix Apple Clang Detection
1 parent 072403e commit b4367d0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Sources/SWBCore/ToolInfo/ClangToolInfo.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,17 @@ public func discoveredClangToolInfo(
118118
// "8.1.0 (clang-802.1.38)"
119119
// "12.0.0 (clang-1200.0.22.5) [ptrauth objc isa mode: sign-and-strip]"
120120
if macroName == "__clang_version__" {
121-
isAppleClang = macroValue.contains("Apple")
122121
if let match: RegEx.MatchResult = clangVersionRe.firstMatch(in: macroValue) {
123122
llvmVersion = match["llvm"].map { try? Version($0) } ?? nil
124123
clangVersion = match["clang"].map { try? Version($0) } ?? nil
125124
} else if let match = try? swiftOSSToolchainClangVersionRe.firstMatch(in: macroValue) {
126125
llvmVersion = try? Version(String(match.llvm))
127126
}
128127
}
128+
129+
if macroName == "__apple_build_version__" {
130+
isAppleClang = true
131+
}
129132
}
130133
}
131134

0 commit comments

Comments
 (0)