[Cmake-commits] [cmake-commits] king committed cmGlobalGenerator.cxx 1.228 1.229 cmGlobalGenerator.h 1.107 1.108 cmTarget.cxx 1.215 1.216 cmTarget.h 1.114 1.115
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon May 12 17:43:51 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv11914/Source
Modified Files:
cmGlobalGenerator.cxx cmGlobalGenerator.h cmTarget.cxx
cmTarget.h
Log Message:
BUG: Make sure all source files are found before generating.
- Previously this was done implicitly by the check for a target
link language which checked all source full paths.
- The recent change to support computing a link language without
finding all the source files skipped the implicit check.
- This change adds an explicit check to find all source files.
Index: cmGlobalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v
retrieving revision 1.107
retrieving revision 1.108
diff -C 2 -d -r1.107 -r1.108
*** cmGlobalGenerator.h 14 Feb 2008 21:42:29 -0000 1.107
--- cmGlobalGenerator.h 12 May 2008 21:43:45 -0000 1.108
***************
*** 261,264 ****
--- 261,266 ----
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
+ bool CheckTargets();
+
// Fill the ProjectMap, this must be called after LocalGenerators
// has been populated.
Index: cmTarget.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.h,v
retrieving revision 1.114
retrieving revision 1.115
diff -C 2 -d -r1.114 -r1.115
*** cmTarget.h 8 Apr 2008 20:13:43 -0000 1.114
--- cmTarget.h 12 May 2008 21:43:45 -0000 1.115
***************
*** 272,275 ****
--- 272,280 ----
void TraceDependencies(const char* vsProjectFile);
+ /**
+ * Make sure the full path to all source files is known.
+ */
+ bool FindSourceFiles();
+
///! Return the prefered linker language for this target
const char* GetLinkerLanguage(cmGlobalGenerator*);
Index: cmGlobalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v
retrieving revision 1.228
retrieving revision 1.229
diff -C 2 -d -r1.228 -r1.229
*** cmGlobalGenerator.cxx 30 Apr 2008 17:42:38 -0000 1.228
--- cmGlobalGenerator.cxx 12 May 2008 21:43:44 -0000 1.229
***************
*** 765,768 ****
--- 765,774 ----
}
+ // Check that all targets are valid.
+ if(!this->CheckTargets())
+ {
+ return;
+ }
+
// For each existing cmLocalGenerator
unsigned int i;
***************
*** 851,854 ****
--- 857,888 ----
}
+ //----------------------------------------------------------------------------
+ bool cmGlobalGenerator::CheckTargets()
+ {
+ // Make sure all targets can find their source files.
+ for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
+ {
+ cmTargets& targets =
+ this->LocalGenerators[i]->GetMakefile()->GetTargets();
+ for(cmTargets::iterator ti = targets.begin();
+ ti != targets.end(); ++ti)
+ {
+ cmTarget& target = ti->second;
+ if(target.GetType() == cmTarget::EXECUTABLE ||
+ target.GetType() == cmTarget::STATIC_LIBRARY ||
+ target.GetType() == cmTarget::SHARED_LIBRARY ||
+ target.GetType() == cmTarget::MODULE_LIBRARY ||
+ target.GetType() == cmTarget::UTILITY)
+ {
+ if(!target.FindSourceFiles())
+ {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
void cmGlobalGenerator::CheckLocalGenerators()
{
Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.215
retrieving revision 1.216
diff -C 2 -d -r1.215 -r1.216
*** cmTarget.cxx 14 Apr 2008 19:27:26 -0000 1.215
--- cmTarget.cxx 12 May 2008 21:43:45 -0000 1.216
***************
*** 1007,1010 ****
--- 1007,1025 ----
//----------------------------------------------------------------------------
+ bool cmTarget::FindSourceFiles()
+ {
+ for(std::vector<cmSourceFile*>::const_iterator
+ si = this->SourceFiles.begin();
+ si != this->SourceFiles.end(); ++si)
+ {
+ if((*si)->GetFullPath().empty())
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ //----------------------------------------------------------------------------
void cmTarget::AddSources(std::vector<std::string> const& srcs)
{
More information about the Cmake-commits
mailing list