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

Method ConstructScript

Source/cmGlobalXCodeGenerator.cxx:2253–2277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2251}
2252
2253std::string cmGlobalXCodeGenerator::ConstructScript(
2254 cmCustomCommandGenerator const& ccg)
2255{
2256 std::string script;
2257 cmLocalGenerator* lg = this->CurrentLocalGenerator;
2258 std::string wd = ccg.GetWorkingDirectory();
2259 if (wd.empty()) {
2260 wd = lg->GetCurrentBinaryDirectory();
2261 }
2262 wd = lg->ConvertToOutputFormat(wd, cmOutputConverter::SHELL);
2263 ReplaceScriptVars(wd);
2264 script = cmStrCat(script, " cd ", wd, '\n');
2265 for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
2266 std::string cmd = ccg.GetCommand(c);
2267 if (cmd.empty()) {
2268 continue;
2269 }
2270 cmSystemTools::ReplaceString(cmd, "/./", "/");
2271 cmd = lg->ConvertToOutputFormat(cmd, cmOutputConverter::SHELL);
2272 ccg.AppendArguments(c, cmd);
2273 ReplaceScriptVars(cmd);
2274 script = cmStrCat(script, " ", cmd, '\n');
2275 }
2276 return script;
2277}
2278
2279// This function removes each occurrence of the flag and returns the last one
2280// (i.e., the dominant flag in GCC)

Callers 6

WriteMethod · 0.45
WriteCustomRuleMethod · 0.45
WriteCustomRuleMethod · 0.45
WriteEventMethod · 0.45
WriteSdkStyleEventMethod · 0.45

Calls 8

ReplaceScriptVarsFunction · 0.85
GetNumberOfCommandsMethod · 0.80
AppendArgumentsMethod · 0.80
cmStrCatFunction · 0.70
GetWorkingDirectoryMethod · 0.45
emptyMethod · 0.45
ConvertToOutputFormatMethod · 0.45
GetCommandMethod · 0.45

Tested by

no test coverage detected