Fix parallel "make install" of CMake itself

Avoid tracing dependencies of GLOBAL_TARGET targets.  The build system
generators are not designed to handle any dependencies that may be
discovered.  Global targets are only generated by CMake and never have
commands that reference targets built in the project anyway.

The exception is when building CMake itself there is a special case to
use the just-built "cmake" binary in the "install" target so that CMake
can replace itself on Windows.  Even in this special case we do not want
to let the "install" target depend on the "cmake" target.  Doing so
breaks cases like "make -j4 install".
This commit is contained in:
Brad King 2010-12-09 10:12:12 -05:00
parent d25638ac05
commit 608d6bba89
1 changed files with 9 additions and 0 deletions

View File

@ -1450,6 +1450,15 @@ cmTargetTraceDependencies
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmTarget::TraceDependencies(const char* vsProjectFile) void cmTarget::TraceDependencies(const char* vsProjectFile)
{ {
// CMake-generated targets have no dependencies to trace. Normally tracing
// would find nothing anyway, but when building CMake itself the "install"
// target command ends up referencing the "cmake" target but we do not
// really want the dependency because "install" depend on "all" anyway.
if(this->GetType() == cmTarget::GLOBAL_TARGET)
{
return;
}
// 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(), vsProjectFile);
tracer.Trace(); tracer.Trace();