summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2013-10-18 10:59:47 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2013-10-24 17:48:18 (GMT)
commiteeb4aece1cf564c10d1c4e7409907ca6c92462ed (patch)
tree33cb678cf9e8faad0027231f7714e4bd49a8fa02 /Source/cmGlobalNinjaGenerator.cxx
parentdca43862f13e1481619fc3ff286662ee93d14af9 (diff)
downloadCMake-eeb4aece1cf564c10d1c4e7409907ca6c92462ed.zip
CMake-eeb4aece1cf564c10d1c4e7409907ca6c92462ed.tar.gz
CMake-eeb4aece1cf564c10d1c4e7409907ca6c92462ed.tar.bz2
Ninja: use deps = gcc/msvc feature
cmcldeps is now only used for .rc file processing
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx36
1 files changed, 31 insertions, 5 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index e45d024..6472949 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -102,6 +102,13 @@ std::string cmGlobalNinjaGenerator::EncodePath(const std::string &path)
return EncodeLiteral(result);
}
+std::string cmGlobalNinjaGenerator::EncodeDepfileSpace(const std::string &path)
+{
+ std::string result = path;
+ cmSystemTools::ReplaceString(result, " ", "\\ ");
+ return result;
+}
+
void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
const std::string& comment,
const std::string& rule,
@@ -236,9 +243,11 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule()
"$DESC",
"Rule for running custom commands.",
/*depfile*/ "",
+ /*deptype*/ "",
/*rspfile*/ "",
/*rspcontent*/ "",
- /*restat*/ true);
+ /*restat*/ true,
+ /*generator*/ false);
}
void
@@ -247,7 +256,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
const std::string& comment,
const cmNinjaDeps& outputs,
const cmNinjaDeps& deps,
- const cmNinjaDeps& orderOnlyDeps)
+ const cmNinjaDeps& orderOnly)
{
std::string cmd = command;
#ifdef _WIN32
@@ -268,7 +277,7 @@ cmGlobalNinjaGenerator::WriteCustomCommandBuild(const std::string& command,
outputs,
deps,
cmNinjaDeps(),
- orderOnlyDeps,
+ orderOnly,
vars);
}
@@ -287,9 +296,13 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule()
this->AddRule("COPY_OSX_CONTENT",
cmd.str(),
"Copying OS X Content $out",
- "Rule for copying OS X bundle content file."
+ "Rule for copying OS X bundle content file.",
/*depfile*/ "",
- /*rspfile*/ "");
+ /*deptype*/ "",
+ /*rspfile*/ "",
+ /*rspcontent*/ "",
+ /*restat*/ false,
+ /*generator*/ false);
}
void
@@ -320,6 +333,7 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
const std::string& description,
const std::string& comment,
const std::string& depfile,
+ const std::string& deptype,
const std::string& rspfile,
const std::string& rspcontent,
bool restat,
@@ -355,6 +369,13 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
os << "depfile = " << depfile << "\n";
}
+ // Write the deptype if any.
+ if (!deptype.empty())
+ {
+ cmGlobalNinjaGenerator::Indent(os, 1);
+ os << "deps = " << deptype << "\n";
+ }
+
// Write the command.
cmGlobalNinjaGenerator::Indent(os, 1);
os << "command = " << command << "\n";
@@ -583,6 +604,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
const std::string& description,
const std::string& comment,
const std::string& depfile,
+ const std::string& deptype,
const std::string& rspfile,
const std::string& rspcontent,
bool restat,
@@ -601,6 +623,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
description,
comment,
depfile,
+ deptype,
rspfile,
rspcontent,
restat,
@@ -1089,6 +1112,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
"Re-running CMake...",
"Rule for re-running cmake.",
/*depfile=*/ "",
+ /*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
/*restat=*/ false,
@@ -1142,6 +1166,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
"Cleaning all built files...",
"Rule for cleaning all built files.",
/*depfile=*/ "",
+ /*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
/*restat=*/ false,
@@ -1164,6 +1189,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
"All primary targets available:",
"Rule for printing all primary targets available.",
/*depfile=*/ "",
+ /*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
/*restat=*/ false,