diff options
author | Brad King <brad.king@kitware.com> | 2015-11-20 13:53:17 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-11-20 13:53:17 (GMT) |
commit | b6f471773d943bfb0f5cc012bce3fd25f5f9f7fa (patch) | |
tree | f1b4c5624266863dce89c9d0c90505d5cb68f5a2 /Source | |
parent | 7171f64cc108dfb4072def578ef38ed8ce99187b (diff) | |
parent | 3477b26ff6c455b64421bf19000d7203acdd6024 (diff) | |
download | CMake-b6f471773d943bfb0f5cc012bce3fd25f5f9f7fa.zip CMake-b6f471773d943bfb0f5cc012bce3fd25f5f9f7fa.tar.gz CMake-b6f471773d943bfb0f5cc012bce3fd25f5f9f7fa.tar.bz2 |
Merge topic 'ninja-symbolic-custom-command'
3477b26f Ninja: Always re-run custom commands that have symbolic dependencies
7d64a059 Ninja: Add 'restat' parameter to custom command generation method
866c75de Ninja: Refactor generation of 'restat' on custom commands
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmGlobalNinjaGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmNinjaUtilityTargetGenerator.cxx | 1 |
4 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index a8a307c..0f06e43 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -275,7 +275,7 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule() /*deptype*/ "", /*rspfile*/ "", /*rspcontent*/ "", - /*restat*/ "1", + /*restat*/ "", // bound on each build statement as needed /*generator*/ false); } @@ -284,6 +284,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, const std::string& description, const std::string& comment, bool uses_terminal, + bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps, const cmNinjaDeps& orderOnly) @@ -300,6 +301,10 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command, cmNinjaVars vars; vars["COMMAND"] = cmd; vars["DESC"] = EncodeLiteral(description); + if (restat) + { + vars["restat"] = "1"; + } if (uses_terminal && SupportsConsolePool()) { vars["pool"] = "console"; @@ -923,6 +928,7 @@ void cmGlobalNinjaGenerator::WriteAssumedSourceDependencies() WriteCustomCommandBuild(/*command=*/"", /*description=*/"", "Assume dependencies for generated source file.", /*uses_terminal*/false, + /*restat*/true, cmNinjaDeps(1, i->first), deps); } } diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h index c494d36..8656590 100644 --- a/Source/cmGlobalNinjaGenerator.h +++ b/Source/cmGlobalNinjaGenerator.h @@ -112,6 +112,7 @@ public: const std::string& description, const std::string& comment, bool uses_terminal, + bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps = cmNinjaDeps(), const cmNinjaDeps& orderOnly = cmNinjaDeps()); diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index ecaa269..b2927a9 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -398,6 +398,16 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( const std::vector<std::string> &byproducts = ccg.GetByproducts(); cmNinjaDeps ninjaOutputs(outputs.size()+byproducts.size()), ninjaDeps; + bool symbolic = false; + for (std::vector<std::string>::const_iterator o = outputs.begin(); + o != outputs.end(); ++o) + { + if (cmSourceFile* sf = this->Makefile->GetSource(*o)) + { + symbolic = sf->GetPropertyAsBool("SYMBOLIC"); + } + } + #if 0 #error TODO: Once CC in an ExternalProject target must provide the \ file of each imported target that has an add_dependencies pointing \ @@ -434,6 +444,7 @@ cmLocalNinjaGenerator::WriteCustomCommandBuildStatement( this->ConstructComment(ccg), "Custom command for " + ninjaOutputs[0], cc->GetUsesTerminal(), + /*restat*/!symbolic, ninjaOutputs, ninjaDeps, orderOnlyDeps); diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx index edc65f0..ac66fcd 100644 --- a/Source/cmNinjaUtilityTargetGenerator.cxx +++ b/Source/cmNinjaUtilityTargetGenerator.cxx @@ -131,6 +131,7 @@ void cmNinjaUtilityTargetGenerator::Generate() desc, "Utility command for " + this->GetTargetName(), uses_terminal, + /*restat*/true, util_outputs, deps); |