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
Another attempt at loading from library path
  • Loading branch information
Teemperor committed Dec 3, 2017
commit a0963eb682fe22463b3c287866e3e79878fa410c
14 changes: 7 additions & 7 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1120,18 +1120,18 @@ static bool IsFromRootCling() {
return foundSymbol;
}

static void loadModulePath(HeaderSearch& hdrSearch, const char* environmentVariable) {
const char* LD_LIBRARY_PATH = getenv(environmentVariable);
if (LD_LIBRARY_PATH) {
StringRef path = LD_LIBRARY_PATH;
static void loadModulePath(HeaderSearch& hdrSearch, const char* inputPath) {
if (inputPath) {
StringRef path = inputPath;
SmallVector<StringRef, 32> paths;
path.split(paths, ":");

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

if (auto file = hdrSearch.getFileMgr().getFile(ModuleMapFilePath))
if (auto file = hdrSearch.getFileMgr().getFile(ModuleMapFilePath)) {
hdrSearch.loadModuleMapFile(file, false, FileID());
}
}
}
}
Expand Down Expand Up @@ -1269,7 +1269,7 @@ TCling::TCling(const char *name, const char *title)
if (fInterpreter->getCI()->getLangOpts().Modules) {
HeaderSearch& hdrSearch = fInterpreter->getCI()->getPreprocessor().getHeaderSearchInfo();
hdrSearch.loadTopLevelSystemModules();
loadModulePath(hdrSearch, "LD_LIBRARY_PATH");
loadModulePath(hdrSearch, gSystem->GetDynamicPath());

// Setup core C++ modules if we have any to setup.
LoadModules({"libc", "stl", "ROOT_Types", "Core", "RIO"}, *fInterpreter);
Expand Down