Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed library loading
  • Loading branch information
Teemperor authored and vgvassilev committed Mar 11, 2018
commit 0650032de8e97ca21a30be64c7261f9fda36e2cf
23 changes: 19 additions & 4 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1121,11 +1121,12 @@ static void loadModulePath(HeaderSearch& hdrSearch, const char* inputPath) {
path.split(paths, ":");

for (StringRef path : paths) {
SmallString<128> ModuleMapFilePath = path;
SmallString<128> ModuleMapFilePath = path;
llvm::sys::path::append(ModuleMapFilePath, "module.modulemap");

if (auto file = hdrSearch.getFileMgr().getFile(ModuleMapFilePath)) {
hdrSearch.loadModuleMapFile(file, false, FileID());
}
if (auto file = hdrSearch.getFileMgr().getFile(ModuleMapFilePath)) {
hdrSearch.loadModuleMapFile(file, false, FileID());
}
}
}
}
Expand Down Expand Up @@ -5149,6 +5150,20 @@ Int_t TCling::LoadLibraryMap(const char* rootmapfile)
}
if (!skip) {
void* dirp = gSystem->OpenDirectory(d);

// Load the modulemap from the dir and add it to the prebuilt module
// path.
// FIXME: This is ROOT quality code, refactor me.
fInterpreter->getCI()->getHeaderSearchOpts().AddPrebuiltModulePath(d.Data());
auto& hdrSearch = fInterpreter->getCI()->getPreprocessor().getHeaderSearchInfo();
SmallString<128> ModuleMapFilePath = StringRef(d.Data());
llvm::sys::path::append(ModuleMapFilePath, "module.modulemap");

if (auto file = hdrSearch.getFileMgr().getFile(ModuleMapFilePath)) {
hdrSearch.loadModuleMapFile(file, false, FileID());
}


if (dirp) {
if (gDebug > 3) {
Info("LoadLibraryMap", "%s", d.Data());
Expand Down