Skip to content

Commit

Permalink
Do not overlay on top of the unix modulemaps.
Browse files Browse the repository at this point in the history
We should have separate cases for unix and apple, otherwise the modulemaps go
on top of each other.
  • Loading branch information
vgvassilev authored and jenkins committed Mar 21, 2024
1 parent ccc4b87 commit eac26aa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ namespace {
llvm::sys::path::append(systemLoc, modulemapFilename);
// Check if we need to mount a custom modulemap. We may have it, for
// instance when we are on osx or using libc++.
if (AllowModulemapOverride &&llvm::sys::fs::exists(systemLoc.str())) {
if (AllowModulemapOverride && llvm::sys::fs::exists(systemLoc.str())) {
if (HSOpts.Verbose)
cling::log() << "Loading '" << systemLoc.str() << "'\n";

Expand Down Expand Up @@ -693,6 +693,12 @@ namespace {
clingIncLoc.str().str(), MOverlay,
/*RegisterModuleMap=*/ true,
/*AllowModulemapOverride=*/ false);
#elif __APPLE__
if (Triple.isMacOSX() && CI.getTarget().getSDKVersion() >= VersionTuple(14, 4))
maybeAppendOverlayEntry(stdIncLoc.str(), "std_darwin.modulemap",
clingIncLoc.str().str(), MOverlay,
/*RegisterModuleMap=*/ true,
/*AllowModulemapOverride=*/ false);
#else
maybeAppendOverlayEntry(cIncLoc.str(), "libc.modulemap",
clingIncLoc.str().str(), MOverlay,
Expand All @@ -702,11 +708,6 @@ namespace {
clingIncLoc.str().str(), MOverlay,
/*RegisterModuleMap=*/ true,
/*AllowModulemapOverride=*/true);
if (Triple.isMacOSX() && CI.getTarget().getSDKVersion() >= VersionTuple(14, 4))
maybeAppendOverlayEntry(stdIncLoc.str(), "std_darwin.modulemap",
clingIncLoc.str().str(), MOverlay,
/*RegisterModuleMap=*/ true,
/*AllowModulemapOverride=*/ false);
#endif // _WIN32

if (!tinyxml2IncLoc.empty())
Expand Down

0 comments on commit eac26aa

Please sign in to comment.