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 committed Dec 3, 2017
commit cae72d1ed091b87486f82c7652d910a564e3b202
23 changes: 19 additions & 4 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1127,11 +1127,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 @@ -5119,6 +5120,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