VS,Xcode: Drop incorrect legacy dependency trace (#14291)

Drop the "vsProjectFile" argument from cmTarget::TraceDependencies.  It
appears to be the modern equivalent to a hunk added in commit ba68f771
(...added new custom command support, 2003-06-03):

 +  name = libName;
 +  name += ".dsp.cmake";
 +  srcFilesToProcess.push(name);

but was broken by refactoring at some point.  The current behavior tries
to trace dependencies on a source file named the same as a target, which
makes no sense.  Furthermore, in code of the form

 add_executable(foo foo.c)
 add_custom_command(OUTPUT "${somewhere}/foo" ... DEPENDS foo)

the "vsProjectFile" value "foo" matches source "${somewhere}/foo.rule"
generated to hold the custom command and causes the command to be added
to the "foo" target incorrectly.

Simply drop the incorrect source file trace and supporting logic.
This commit is contained in:
Brad King 2013-07-15 12:47:27 -04:00
parent b5dd80105f
commit 4bb6e24809
6 changed files with 6 additions and 25 deletions

View File

@ -55,7 +55,6 @@ cmLocalGenerator::cmLocalGenerator()
this->UseRelativePaths = false; this->UseRelativePaths = false;
this->Configured = false; this->Configured = false;
this->EmitUniversalBinaryFlags = true; this->EmitUniversalBinaryFlags = true;
this->IsMakefileGenerator = false;
this->RelativePathsConfigured = false; this->RelativePathsConfigured = false;
this->PathConversionsSetup = false; this->PathConversionsSetup = false;
this->BackwardsCompatibility = 0; this->BackwardsCompatibility = 0;
@ -260,12 +259,7 @@ void cmLocalGenerator::TraceDependencies()
cmTargets& targets = this->Makefile->GetTargets(); cmTargets& targets = this->Makefile->GetTargets();
for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t) for(cmTargets::iterator t = targets.begin(); t != targets.end(); ++t)
{ {
const char* projectFilename = 0; t->second.TraceDependencies();
if (this->IsMakefileGenerator == false) // only use of this variable
{
projectFilename = t->second.GetName();
}
t->second.TraceDependencies(projectFilename);
} }
} }

View File

@ -435,8 +435,6 @@ protected:
bool IgnoreLibPrefix; bool IgnoreLibPrefix;
bool Configured; bool Configured;
bool EmitUniversalBinaryFlags; bool EmitUniversalBinaryFlags;
// A type flag is not nice. It's used only in TraceDependencies().
bool IsMakefileGenerator;
// Hack for ExpandRuleVariable until object-oriented version is // Hack for ExpandRuleVariable until object-oriented version is
// committed. // committed.
std::string TargetImplib; std::string TargetImplib;

View File

@ -27,7 +27,6 @@ cmLocalNinjaGenerator::cmLocalNinjaGenerator()
, ConfigName("") , ConfigName("")
, HomeRelativeOutputPath("") , HomeRelativeOutputPath("")
{ {
this->IsMakefileGenerator = true;
#ifdef _WIN32 #ifdef _WIN32
this->WindowsShell = true; this->WindowsShell = true;
#endif #endif

View File

@ -92,7 +92,6 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
this->SkipPreprocessedSourceRules = false; this->SkipPreprocessedSourceRules = false;
this->SkipAssemblySourceRules = false; this->SkipAssemblySourceRules = false;
this->MakeCommandEscapeTargetTwice = false; this->MakeCommandEscapeTargetTwice = false;
this->IsMakefileGenerator = true;
this->BorlandMakeCurlyHack = false; this->BorlandMakeCurlyHack = false;
} }

View File

@ -1789,8 +1789,7 @@ bool cmTarget::IsBundleOnApple()
class cmTargetTraceDependencies class cmTargetTraceDependencies
{ {
public: public:
cmTargetTraceDependencies(cmTarget* target, cmTargetInternals* internal, cmTargetTraceDependencies(cmTarget* target, cmTargetInternals* internal);
const char* vsProjectFile);
void Trace(); void Trace();
private: private:
cmTarget* Target; cmTarget* Target;
@ -1814,8 +1813,7 @@ private:
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTargetTraceDependencies cmTargetTraceDependencies
::cmTargetTraceDependencies(cmTarget* target, cmTargetInternals* internal, ::cmTargetTraceDependencies(cmTarget* target, cmTargetInternals* internal):
const char* vsProjectFile):
Target(target), Internal(internal) Target(target), Internal(internal)
{ {
// Convenience. // Convenience.
@ -1832,13 +1830,6 @@ cmTargetTraceDependencies
this->QueueSource(*si); this->QueueSource(*si);
} }
// Queue the VS project file to check dependencies on the rule to
// generate it.
if(vsProjectFile)
{
this->FollowName(vsProjectFile);
}
// Queue pre-build, pre-link, and post-build rule dependencies. // Queue pre-build, pre-link, and post-build rule dependencies.
this->CheckCustomCommands(this->Target->GetPreBuildCommands()); this->CheckCustomCommands(this->Target->GetPreBuildCommands());
this->CheckCustomCommands(this->Target->GetPreLinkCommands()); this->CheckCustomCommands(this->Target->GetPreLinkCommands());
@ -2057,7 +2048,7 @@ cmTargetTraceDependencies
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::TraceDependencies(const char* vsProjectFile) void cmTarget::TraceDependencies()
{ {
// CMake-generated targets have no dependencies to trace. Normally tracing // CMake-generated targets have no dependencies to trace. Normally tracing
// would find nothing anyway, but when building CMake itself the "install" // would find nothing anyway, but when building CMake itself the "install"
@ -2069,7 +2060,7 @@ void cmTarget::TraceDependencies(const char* vsProjectFile)
} }
// Use a helper object to trace the dependencies. // Use a helper object to trace the dependencies.
cmTargetTraceDependencies tracer(this, this->Internal.Get(), vsProjectFile); cmTargetTraceDependencies tracer(this, this->Internal.Get());
tracer.Trace(); tracer.Trace();
} }

View File

@ -341,7 +341,7 @@ public:
* Trace through the source files in this target and add al source files * Trace through the source files in this target and add al source files
* that they depend on, used by all generators * that they depend on, used by all generators
*/ */
void TraceDependencies(const char* vsProjectFile); void TraceDependencies();
/** /**
* Make sure the full path to all source files is known. * Make sure the full path to all source files is known.