summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaUtilityTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmNinjaUtilityTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index 1a7b445..f5d18dc 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmMakefile.h"
#include "cmSourceFile.h"
#include "cmTarget.h"
+#include "cmCustomCommandGenerator.h"
cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
cmGeneratorTarget *target)
@@ -37,22 +38,28 @@ void cmNinjaUtilityTargetGenerator::Generate()
for (unsigned i = 0; i != 2; ++i) {
for (std::vector<cmCustomCommand>::const_iterator
ci = cmdLists[i]->begin(); ci != cmdLists[i]->end(); ++ci) {
- this->GetLocalGenerator()->AppendCustomCommandDeps(&*ci, deps);
- this->GetLocalGenerator()->AppendCustomCommandLines(&*ci, commands);
+ cmCustomCommandGenerator ccg(*ci, this->GetConfigName(),
+ this->GetMakefile());
+ this->GetLocalGenerator()->AppendCustomCommandDeps(ccg, deps);
+ this->GetLocalGenerator()->AppendCustomCommandLines(ccg, commands);
}
}
std::vector<cmSourceFile*> sources;
- this->GetTarget()->GetSourceFiles(sources);
+ std::string config = this->GetMakefile()
+ ->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ this->GetTarget()->GetSourceFiles(sources, config);
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
if(cmCustomCommand* cc = (*source)->GetCustomCommand())
{
+ cmCustomCommandGenerator ccg(*cc, this->GetConfigName(),
+ this->GetMakefile());
this->GetLocalGenerator()->AddCustomCommandTarget(cc, this->GetTarget());
// Depend on all custom command outputs.
- const std::vector<std::string>& ccOutputs = cc->GetOutputs();
+ const std::vector<std::string>& ccOutputs = ccg.GetOutputs();
std::transform(ccOutputs.begin(), ccOutputs.end(),
std::back_inserter(deps), MapToNinjaPath());
}