diff options
author | Brad King <brad.king@kitware.com> | 2001-12-10 16:03:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2001-12-10 16:03:44 (GMT) |
commit | ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17 (patch) | |
tree | 38243b41866b811c6ec18c7f444d097881da60df /Source/cmUnixMakefileGenerator.cxx | |
parent | a946931f91bfffe8ce06a9924beb424cb0233907 (diff) | |
download | CMake-ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17.zip CMake-ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17.tar.gz CMake-ee31c3e0a433c8ed31eac4d8ae898c67c7a51b17.tar.bz2 |
ENH: SUBDIR_DEPENDS command now does nothing. The parallel build functionality is now automatic. Dependencies are setup to force the same build order as a single threaded build, but multiple files in the same directory can be built simultaneously. Also fixed bug with inheriting CMakeLists.txt files when a directory level is skipped.
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r-- | Source/cmUnixMakefileGenerator.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 1a1c48f..0461723 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -1013,18 +1013,22 @@ OutputSubDirectoryVars(std::ostream& fout, } } fout << "# Targets for making " << target << " in subdirectories.\n"; + std::string last = ""; for(unsigned int i =0; i < SubDirectories.size(); i++) { std::string subdir = FixDirectoryName(SubDirectories[i].c_str()); fout << target << "_" << subdir.c_str() << ":"; - const std::set<cmStdString>& subdirDepends = m_Makefile->GetSubdirDepends(SubDirectories[i].c_str()); - for(std::set<cmStdString>::const_iterator d = subdirDepends.begin(); - d != subdirDepends.end(); ++d) + + // Make each subdirectory depend on previous one. This forces + // parallel builds (make -j 2) to build in same order as a single + // threaded build to avoid dependency problems. + if(i > 0) { - std::string fixed_d = FixDirectoryName(d->c_str()); - fout << " " << target << "_" << fixed_d.c_str(); + fout << " " << target << "_" << last.c_str(); } + fout << "\n"; + last = subdir; this->BuildInSubDirectory(fout, SubDirectories[i].c_str(), target1, target2); } |