| 280 | } |
| 281 | |
| 282 | void cmCustomCommandGenerator::FillEmulatorsWithArguments() |
| 283 | { |
| 284 | if (!this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING")) { |
| 285 | return; |
| 286 | } |
| 287 | cmGeneratorExpression ge(*this->LG->GetCMakeInstance(), |
| 288 | this->CC->GetBacktrace()); |
| 289 | |
| 290 | for (unsigned int c = 0; c < this->GetNumberOfCommands(); ++c) { |
| 291 | // If the command is the plain name of an executable target, |
| 292 | // launch it with its emulator. |
| 293 | std::string const& argv0 = this->CommandLines[c][0]; |
| 294 | cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0); |
| 295 | if (target && target->GetType() == cmStateEnums::EXECUTABLE && |
| 296 | !target->IsImported()) { |
| 297 | |
| 298 | cmValue emulator_property = |
| 299 | target->GetProperty("CROSSCOMPILING_EMULATOR"); |
| 300 | if (!emulator_property) { |
| 301 | continue; |
| 302 | } |
| 303 | |
| 304 | // Plain target names are replaced by GetArgv0Location with the |
| 305 | // path to the executable artifact in the command config, so |
| 306 | // evaluate the launcher's location in the command config too. |
| 307 | std::string const emulator = |
| 308 | ge.Parse(*emulator_property)->Evaluate(this->LG, this->CommandConfig); |
| 309 | cmExpandList(emulator, this->EmulatorsWithArguments[c]); |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | std::vector<std::string> cmCustomCommandGenerator::GetCrossCompilingEmulator( |
| 315 | unsigned int c) const |
no test coverage detected