[Cmake-commits] CMake branch, next, updated. v2.8.11-2522-g6aa8810
Brad King
brad.king at kitware.com
Tue Jun 4 14:55:17 EDT 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 6aa8810ffdff230ad09b5cba61fe746dad090b4d (commit)
via 9fa668ce0b3ffd29aaae9719b00c2220dd6bd8ab (commit)
from 0a95eb978f02a39fff8efa9074b45146d81a57b7 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6aa8810ffdff230ad09b5cba61fe746dad090b4d
commit 6aa8810ffdff230ad09b5cba61fe746dad090b4d
Merge: 0a95eb9 9fa668c
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 4 14:55:15 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jun 4 14:55:15 2013 -0400
Merge topic 'ninja_phony_file_targets' into next
9fa668c Revert topic 'ninja_phony_file_targets'
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9fa668ce0b3ffd29aaae9719b00c2220dd6bd8ab
commit 9fa668ce0b3ffd29aaae9719b00c2220dd6bd8ab
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jun 4 14:52:35 2013 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jun 4 14:52:35 2013 -0400
Revert topic 'ninja_phony_file_targets'
This will be replaced by a new implementation in another topic.
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 29045a9..fa277b1 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -250,6 +250,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
cmNinjaVars vars;
vars["COMMAND"] = cmd;
vars["DESC"] = EncodeLiteral(description);
+
cmGlobalNinjaGenerator::WriteBuild(*this->BuildFileStream,
comment,
"CUSTOM_COMMAND",
@@ -258,14 +259,6 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
cmNinjaDeps(),
orderOnlyDeps,
vars);
-
-//we need to track every dependency that comes in, since we are trying
-//to find dependencies that are side effects of other custom commands
-//
-for(cmNinjaDeps::const_iterator i=deps.begin(); i != deps.end(); ++i)
- {
- this->UnknownCustomCommandFileDependencies.insert(*i);
- }
}
void
@@ -485,7 +478,6 @@ void cmGlobalNinjaGenerator::Generate()
this->WriteAssumedSourceDependencies();
this->WriteTargetAliases(*this->BuildFileStream);
- this->WriteUnknownCustomDependencies(*this->BuildFileStream);
this->WriteBuiltinTargets(*this->BuildFileStream);
if (cmSystemTools::GetErrorOccuredFlag()) {
@@ -893,7 +885,7 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
cmGlobalNinjaGenerator::WriteDivider(os);
os << "# Target aliases.\n\n";
- for (TargetAliasMap::const_iterator i = TargetAliases.begin();
+ for (TargetAliasMap::iterator i = TargetAliases.begin();
i != TargetAliases.end(); ++i) {
// Don't write ambiguous aliases.
if (!i->second)
@@ -909,64 +901,6 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
}
}
-void cmGlobalNinjaGenerator::WriteUnknownCustomDependencies(std::ostream& os)
-{
- //now write out the unknown dependencies. Don't write out any
- //of these that are now have been added as a known output, file
- //dependency or alias
- cmGlobalNinjaGenerator::WriteDivider(os);
- os << "# Unknown Build Time Dependencies."
- << "# Tell Ninja that they may appear as side effects of build rules"
- << "# otherwise ordered by order-only dependencies.\n\n";
-
- std::string const rootBuildDirectory =
- this->GetCMakeInstance()->GetHomeOutputDirectory();
-
- //remove the following possible targets that we know
- //are false positives
- UnknownCustomCommandFileDependencies.erase("all");
-
- //get the list of files that cmake itself has generated as a
- //product of configuration.
- std::set<std::string> configuredFiles;
- for (std::vector<cmLocalGenerator *>::const_iterator i =
- this->LocalGenerators.begin(); i != this->LocalGenerators.end(); ++i)
- {
- const std::vector<std::string>& of = (*i)->GetMakefile()->GetOutputFiles();
- configuredFiles.insert(of.begin(), of.end());
- }
-
- typedef std::set<std::string>::const_iterator uccfd_iterator;
- for (uccfd_iterator i = UnknownCustomCommandFileDependencies.begin();
- i != UnknownCustomCommandFileDependencies.end(); ++i)
- {
- bool isUnknown = ( this->CustomCommandOutputs.find(*i) ==
- this->CustomCommandOutputs.end() );
- isUnknown = isUnknown && configuredFiles.count(*i) == 0;
- isUnknown = isUnknown && this->TargetAliases.count(*i) == 0;
-
- if(!isUnknown)
- {
- continue;
- }
-
- //verify the file is in the build directory
-
- std::string const absDepPath = cmSystemTools::CollapseFullPath(
- i->c_str(), rootBuildDirectory.c_str());
- bool const inBuildDir = cmSystemTools::IsSubDirectory(absDepPath.c_str(),
- rootBuildDirectory.c_str());
- if(inBuildDir)
- {
- cmNinjaDeps deps(1,*i);
- cmGlobalNinjaGenerator::WritePhonyBuild(os,
- "",
- deps,
- deps);
- }
- }
-}
-
void cmGlobalNinjaGenerator::WriteBuiltinTargets(std::ostream& os)
{
// Write headers.
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 0f4c7e6..c3df7d9 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -320,7 +320,6 @@ private:
void WriteAssumedSourceDependencies();
void WriteTargetAliases(std::ostream& os);
- void WriteUnknownCustomDependencies(std::ostream& os);
void WriteBuiltinTargets(std::ostream& os);
void WriteTargetAll(std::ostream& os);
@@ -358,11 +357,6 @@ private:
/// The set of custom command outputs we have seen.
std::set<std::string> CustomCommandOutputs;
- /// the set of custom command files dependencies that we haven't
- /// been able to find ownership of. These are presumed to be
- /// created as a side effect of some custom command
- std::set<std::string> UnknownCustomCommandFileDependencies;
-
/// The mapping from source file to assumed dependencies.
std::map<std::string, std::set<std::string> > AssumedSourceDependencies;
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index 30daa7d..d3ced3f 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -123,19 +123,6 @@ add_custom_command(
COMMENT "Running TDocument post-build commands"
)
-# Setup a custom target that will fail if the POST_BUILD custom command
-# isn't run before it.
-add_custom_command(
- OUTPUT doc3post.txt
- DEPENDS ${PROJECT_BINARY_DIR}/doc2post.txt
- COMMAND ${CMAKE_COMMAND} -E echo " Copying doc2pre.txt to doc3post.txt."
- COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc2post.txt
- ${PROJECT_BINARY_DIR}/doc3post.txt
- COMMENT "Running TDocument post-build dependent custom command"
- )
-add_custom_target(doc3Post ALL DEPENDS doc3post.txt)
-add_dependencies(doc3Post TDocument)
-
################################################################
#
# Test using a multistep generated file
-----------------------------------------------------------------------
Summary of changes:
Source/cmGlobalNinjaGenerator.cxx | 70 +----------------------------------
Source/cmGlobalNinjaGenerator.h | 6 ---
Tests/CustomCommand/CMakeLists.txt | 13 -------
3 files changed, 2 insertions(+), 87 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list