| 2251 | } |
| 2252 | |
| 2253 | std::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) |
no test coverage detected