Skip to content

Commit ad938a9

Browse files
authored
Merge pull request #60265 from 3405691582/CorrectVFSExclusion
Correct VFS libc modulemap injection condition.
2 parents ba001ec + 6a55161 commit ad938a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/ClangImporter/ClangIncludePaths.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,15 @@ createClangArgs(const ASTContext &ctx, clang::driver::Driver &clangDriver) {
171171
return clangDriverArgs;
172172
}
173173

174+
static bool shouldInjectGlibcModulemap(const llvm::Triple &triple) {
175+
return triple.isOSGlibc() || triple.isOSOpenBSD() || triple.isOSFreeBSD() ||
176+
triple.isAndroid();
177+
}
178+
174179
static SmallVector<std::pair<std::string, std::string>, 2>
175180
getGlibcFileMapping(ASTContext &ctx) {
176181
const llvm::Triple &triple = ctx.LangOpts.Target;
177-
// We currently only need this when building for Linux.
178-
if (!triple.isOSLinux())
182+
if (!shouldInjectGlibcModulemap(triple))
179183
return {};
180184

181185
// Extract the Glibc path from Clang driver.

0 commit comments

Comments
 (0)