Skip to content

Commit 68db1b4

Browse files
[ClangImporter] Don't add cxx shim module map when not needed
Don't add cxx shim when c++ interop is not used. This is to cut down the unnecessary dependencies that are not seen by the dependency scanner.
1 parent 8bd4ac8 commit 68db1b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,10 @@ importer::getNormalInvocationArguments(
547547
});
548548
}
549549

550-
if (auto path = getCxxShimModuleMapPath(searchPathOpts, triple)) {
551-
invocationArgStrs.push_back((Twine("-fmodule-map-file=") + *path).str());
550+
if (LangOpts.EnableCXXInterop) {
551+
if (auto path = getCxxShimModuleMapPath(searchPathOpts, triple)) {
552+
invocationArgStrs.push_back((Twine("-fmodule-map-file=") + *path).str());
553+
}
552554
}
553555

554556
// Set C language options.

0 commit comments

Comments
 (0)