MCPcopy Create free account
hub / github.com/Kitware/CMake / RunListFile

Method RunListFile

Source/cmMakefile.cxx:861–914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861void cmMakefile::RunListFile(cmListFile const& listFile,
862 std::string const& filenametoread,
863 DeferCommands* defer)
864{
865 // add this list file to the list of dependencies
866 this->ListFiles.push_back(filenametoread);
867
868 // Run the parsed commands.
869 size_t const numberFunctions = listFile.Functions.size();
870 for (size_t i = 0; i < numberFunctions; ++i) {
871 cmExecutionStatus status(*this);
872 this->ExecuteCommand(listFile.Functions[i], status);
873 if (cmSystemTools::GetFatalErrorOccurred()) {
874 break;
875 }
876 if (status.HasExitCode()) {
877 // cmake_language EXIT was requested, early break.
878 this->GetCMakeInstance()->SetScriptModeExitCode(status.GetExitCode());
879 break;
880 }
881 if (status.GetReturnInvoked()) {
882 this->RaiseScope(status.GetReturnVariables());
883 // Exit early due to return command.
884 break;
885 }
886 }
887
888 // Run any deferred commands.
889 if (defer) {
890 // Add a backtrace level indicating calls are deferred.
891 DeferScope scope(this, filenametoread);
892
893 // Iterate by index in case one deferred call schedules another.
894 // NOLINTNEXTLINE(modernize-loop-convert)
895 for (size_t i = 0; i < defer->Commands.size(); ++i) {
896 DeferCommand& d = defer->Commands[i];
897 if (d.Id.empty()) {
898 // Canceled.
899 continue;
900 }
901 // Mark as executed.
902 std::string id = std::move(d.Id);
903
904 // The deferred call may have come from another file.
905 DeferCallScope callScope(this, d.FilePath);
906
907 cmExecutionStatus status(*this);
908 this->ExecuteCommand(d.Command, status, std::move(id));
909 if (cmSystemTools::GetFatalErrorOccurred()) {
910 break;
911 }
912 }
913 }
914}
915
916void cmMakefile::EnforceDirectoryLevelRules() const
917{

Callers 4

ReadDependentFileMethod · 0.95
ReadListFileMethod · 0.95
ReadListFileAsStringMethod · 0.95
ConfigureMethod · 0.95

Calls 11

ExecuteCommandMethod · 0.95
GetCMakeInstanceMethod · 0.95
RaiseScopeMethod · 0.95
moveFunction · 0.85
push_backMethod · 0.80
HasExitCodeMethod · 0.80
SetScriptModeExitCodeMethod · 0.80
GetExitCodeMethod · 0.80
GetReturnInvokedMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected