summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-28 12:38:40 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-28 12:38:40 (GMT)
commite378bc6441331d99663048dd131c650bac8f9751 (patch)
tree3514bd914793f93e7edc9d157c556d43c9180f5f /Source/cmGlobalNinjaGenerator.cxx
parent25cfc1e38095ed3cf2c9e94f4fd4d0f9bc0a2111 (diff)
parenteeb4aece1cf564c10d1c4e7409907ca6c92462ed (diff)
downloadCMake-e378bc6441331d99663048dd131c650bac8f9751.zip
CMake-e378bc6441331d99663048dd131c650bac8f9751.tar.gz
CMake-e378bc6441331d99663048dd131c650bac8f9751.tar.bz2
Merge topic 'ninja-use-deps'
eeb4aec Ninja: use deps = gcc/msvc feature
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 bdc08b3..d262397 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";
@@ -579,6 +600,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,
@@ -597,6 +619,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
description,
comment,
depfile,
+ deptype,
rspfile,
rspcontent,
restat,
@@ -1085,6 +1108,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
"Re-running CMake...",
"Rule for re-running cmake.",
/*depfile=*/ "",
+ /*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
/*restat=*/ false,
@@ -1138,6 +1162,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
"Cleaning all built files...",
"Rule for cleaning all built files.",
/*depfile=*/ "",
+ /*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
/*restat=*/ false,
@@ -1160,6 +1185,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
"All primary targets available:",
"Rule for printing all primary targets available.",
/*depfile=*/ "",
+ /*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
/*restat=*/ false,