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

Method FillEmulatorsWithArguments

Source/cmCustomCommandGenerator.cxx:282–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void 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
314std::vector<std::string> cmCustomCommandGenerator::GetCrossCompilingEmulator(
315 unsigned int c) const

Callers 1

Calls 12

GetNumberOfCommandsMethod · 0.95
cmExpandListFunction · 0.85
IsOnMethod · 0.45
GetMakefileMethod · 0.45
GetCMakeInstanceMethod · 0.45
GetBacktraceMethod · 0.45
GetTypeMethod · 0.45
IsImportedMethod · 0.45
GetPropertyMethod · 0.45
EvaluateMethod · 0.45
ParseMethod · 0.45

Tested by

no test coverage detected