diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index d6b35d42f0879..ad9262a6f6dc7 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -1176,8 +1176,6 @@ TCling::TCling(const char *name, const char *title, const char* const argv[]) #ifdef R__USE_CXXMODULES useCxxModules = true; #endif - if (useCxxModules) - fHeaderParsingOnDemand = false; llvm::install_fatal_error_handler(&exceptionErrorHandler); @@ -1755,6 +1753,10 @@ void TCling::RegisterModule(const char* modulename, // I/O; see rootcling.cxx after the call to TCling__GetInterpreter(). if (fromRootCling) return; + // When we cannot provide a module for the library we should enable header + // parsing. This 'mixed' mode ensures gradual migration to modules. + fHeaderParsingOnDemand = !hasCxxModule; + // Treat Aclic Libs in a special way. Do not delay the parsing. bool hasHeaderParsingOnDemand = fHeaderParsingOnDemand; bool isACLiC = strstr(modulename, "_ACLiC_dict") != nullptr;