diff --git a/cmake/modules/RootNewMacros.cmake b/cmake/modules/RootNewMacros.cmake index 7117cadd9d9d2..96ac4808cdd87 100644 --- a/cmake/modules/RootNewMacros.cmake +++ b/cmake/modules/RootNewMacros.cmake @@ -389,6 +389,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary) if(cpp_module_file) set(newargs -cxxmodule ${newargs}) + set(pcm_name) endif() #---what rootcling command to use-------------------------- diff --git a/core/dictgen/src/rootcling_impl.cxx b/core/dictgen/src/rootcling_impl.cxx index b53b7352f9b0b..5a3d0cba9fd91 100644 --- a/core/dictgen/src/rootcling_impl.cxx +++ b/core/dictgen/src/rootcling_impl.cxx @@ -2984,8 +2984,8 @@ int CheckClassesForInterpreterOnlyDicts(cling::Interpreter &interp, //////////////////////////////////////////////////////////////////////////////// /// Make up for skipping RegisterModule, now that dictionary parsing /// is done and these headers cannot be selected anymore. - -int FinalizeStreamerInfoWriting(cling::Interpreter &interp, bool writeEmptyRootPCM=false) +/// +int MaybeEmitROOTPCM(cling::Interpreter &interp, bool writeEmptyRootPCM=false) { if (!gDriverConfig->fCloseStreamerInfoROOTFile) return 0; @@ -3022,7 +3022,8 @@ int GenerateFullDict(std::ostream &dictStream, const ROOT::TMetaUtils::RConstructorTypes &ctorTypes, bool isSplit, bool isGenreflex, - bool writeEmptyRootPCM) + bool writeEmptyRootPCM, + bool hasCxxModule) { ROOT::TMetaUtils::TNormalizedCtxt normCtxt(interp.getLookupHelper()); @@ -3134,12 +3135,12 @@ int GenerateFullDict(std::ostream &dictStream, // coverity[fun_call_w_exception] - that's just fine. ROOT::Internal::RStl::Instance().WriteClassInit(dictStream, interp, normCtxt, ctorTypes, needsCollectionProxy, EmitStreamerInfo); - if (!gDriverConfig->fBuildingROOTStage1) { + if (!hasCxxModule && !gDriverConfig->fBuildingROOTStage1) { EmitTypedefs(scan.fSelectedTypedefs); EmitEnums(scan.fSelectedEnums); // Make up for skipping RegisterModule, now that dictionary parsing // is done and these headers cannot be selected anymore. - int finRetCode = FinalizeStreamerInfoWriting(interp, writeEmptyRootPCM); + int finRetCode = MaybeEmitROOTPCM(interp, writeEmptyRootPCM); if (finRetCode != 0) return finRetCode; } @@ -5013,17 +5014,18 @@ int RootClingMain(int argc, rootclingRetCode += CheckClassesForInterpreterOnlyDicts(interp, scan); // generate an empty pcm nevertheless for consistency // Negate as true is 1 and true is returned in case of success. - if (!gDriverConfig->fBuildingROOTStage1) { - rootclingRetCode += FinalizeStreamerInfoWriting(interp); + if (!cxxmodule && !gDriverConfig->fBuildingROOTStage1) { + rootclingRetCode += MaybeEmitROOTPCM(interp); } } else { rootclingRetCode += GenerateFullDict(splitDictStream, - interp, - scan, - constructorTypes, - doSplit, - isGenreflex, - writeEmptyRootPCM); + interp, + scan, + constructorTypes, + doSplit, + isGenreflex, + writeEmptyRootPCM, + cxxmodule); } if (rootclingRetCode != 0) {