mirror of
https://github.com/reactos/CMake.git
synced 2024-11-27 21:41:03 +00:00
Remove cmLocalGenerator::GetRealLocation
The cmCustomCommandGenerator::GetCommand method completely replaces the purpose of this method. Re-implement GetRealLocation inline at the only remaining call site and remove it.
This commit is contained in:
parent
542b517449
commit
1a29ccaf9a
@ -33,7 +33,13 @@ unsigned int cmCustomCommandGenerator::GetNumberOfCommands() const
|
||||
std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
|
||||
{
|
||||
std::string const& argv0 = this->CC.GetCommandLines()[c][0];
|
||||
return this->LG->GetRealLocation(argv0.c_str(), this->Config);
|
||||
cmTarget* target = this->Makefile->FindTargetToUse(argv0.c_str());
|
||||
if(target && target->GetType() == cmTarget::EXECUTABLE &&
|
||||
(target->IsImported() || !this->Makefile->IsOn("CMAKE_CROSSCOMPILING")))
|
||||
{
|
||||
return target->GetLocation(this->Config);
|
||||
}
|
||||
return argv0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -1912,24 +1912,6 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
std::string cmLocalGenerator::GetRealLocation(const char* inName,
|
||||
const char* config)
|
||||
{
|
||||
std::string outName=inName;
|
||||
// Look for a CMake target with the given name, which is an executable
|
||||
// and which can be run
|
||||
cmTarget* target = this->Makefile->FindTargetToUse(inName);
|
||||
if ((target != 0)
|
||||
&& (target->GetType() == cmTarget::EXECUTABLE)
|
||||
&& ((this->Makefile->IsOn("CMAKE_CROSSCOMPILING") == false)
|
||||
|| (target->IsImported() == true)))
|
||||
{
|
||||
outName = target->GetLocation( config );
|
||||
}
|
||||
return outName;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
void cmLocalGenerator::AddSharedFlags(std::string& flags,
|
||||
const char* lang,
|
||||
|
@ -168,11 +168,6 @@ public:
|
||||
bool GetRealDependency(const char* name, const char* config,
|
||||
std::string& dep);
|
||||
|
||||
/** Translate a command as given in CMake code to the location of the
|
||||
executable if the command is the name of a CMake executable target.
|
||||
If that's not the case, just return the original name. */
|
||||
std::string GetRealLocation(const char* inName, const char* config);
|
||||
|
||||
///! for existing files convert to output path and short path if spaces
|
||||
std::string ConvertToOutputForExisting(const char* remote,
|
||||
RelativeRoot local = START_OUTPUT);
|
||||
|
Loading…
Reference in New Issue
Block a user