Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ endif()

if(runtime_cxxmodules)
# Dummy target that does nothing, we don't need a PCH for modules.
add_custom_target(onepcm)
add_custom_target(onepcm DEPENDS TreePlayer TMVA Graf)
else()
add_custom_command(OUTPUT etc/allDict.cxx.pch
COMMAND ${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch ${__allIncludes} -I${CMAKE_BINARY_DIR}/include
Expand Down
15 changes: 12 additions & 3 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,8 @@ static void LoadCoreModules(cling::Interpreter &interp)
if (!CI.getLangOpts().Modules)
return;

bool fromRootCling = dlsym(RTLD_DEFAULT, "usedToIdentifyRootClingByDlSym");

clang::HeaderSearch &headerSearch = CI.getPreprocessor().getHeaderSearchInfo();
clang::ModuleMap &moduleMap = headerSearch.getModuleMap();
// List of core modules we can load, but it's ok if they are missing because
Expand All @@ -1107,6 +1109,13 @@ static void LoadCoreModules(cling::Interpreter &interp)

// List of core modules we need to load.
std::vector<std::string> neededCoreModuleNames = {"Core", "RIO"};

if (!fromRootCling) {
neededCoreModuleNames.push_back("TreePlayer");
neededCoreModuleNames.push_back("TMVA");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you load Graf for TPaveText? That's stumbling my PR #1356.

neededCoreModuleNames.push_back("Graf");
}

std::vector<std::string> missingCoreModuleNames;

std::vector<clang::Module *> coreModules;
Expand Down Expand Up @@ -1333,9 +1342,6 @@ TCling::TCling(const char *name, const char *title)
"using namespace std;");
}

// Setup core C++ modules if we have any to setup.
LoadCoreModules(*fInterpreter);

// We are now ready (enough is loaded) to init the list of opaque typedefs.
fNormalizedCtxt = new ROOT::TMetaUtils::TNormalizedCtxt(fInterpreter->getLookupHelper());
fLookupHelper = new ROOT::TMetaUtils::TClingLookupHelper(*fInterpreter, *fNormalizedCtxt, TClingLookupHelper__ExistingTypeCheck, TClingLookupHelper__AutoParse);
Expand Down Expand Up @@ -1408,6 +1414,9 @@ TCling::~TCling()
void TCling::Initialize()
{
fClingCallbacks->Initialize();

// Setup core C++ modules if we have any to setup.
LoadCoreModules(*fInterpreter);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down