summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-11-13 23:32:44 (GMT)
committerBrad King <brad.king@kitware.com>2014-11-14 21:16:00 (GMT)
commit67bd514adce689f4c7f537cdc446c01f7373f5a5 (patch)
tree4ed0993ebebd0ee07f0cdb6b43e3fc718cea7df2 /Source
parentef42e57d470db499a41c8bca695391c3e3e5cb86 (diff)
downloadCMake-67bd514adce689f4c7f537cdc446c01f7373f5a5.zip
CMake-67bd514adce689f4c7f537cdc446c01f7373f5a5.tar.gz
CMake-67bd514adce689f4c7f537cdc446c01f7373f5a5.tar.bz2
Ninja: Refactor restat to be a string internally
This will allow values other than "" and "1" to be generated in the rules.ninja file.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx18
-rw-r--r--Source/cmGlobalNinjaGenerator.h4
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx6
-rw-r--r--Source/cmNinjaTargetGenerator.cxx2
4 files changed, 15 insertions, 15 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 60ab3e4..6f0586b 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -242,7 +242,7 @@ void cmGlobalNinjaGenerator::AddCustomCommandRule()
/*deptype*/ "",
/*rspfile*/ "",
/*rspcontent*/ "",
- /*restat*/ true,
+ /*restat*/ "1",
/*generator*/ false);
}
@@ -309,7 +309,7 @@ cmGlobalNinjaGenerator::AddMacOSXContentRule()
/*deptype*/ "",
/*rspfile*/ "",
/*rspcontent*/ "",
- /*restat*/ false,
+ /*restat*/ "",
/*generator*/ false);
}
@@ -344,7 +344,7 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
const std::string& deptype,
const std::string& rspfile,
const std::string& rspcontent,
- bool restat,
+ const std::string& restat,
bool generator)
{
// Make sure the rule has a name.
@@ -408,10 +408,10 @@ void cmGlobalNinjaGenerator::WriteRule(std::ostream& os,
os << "rspfile_content = " << rspcontent << "\n";
}
- if(restat)
+ if(!restat.empty())
{
cmGlobalNinjaGenerator::Indent(os, 1);
- os << "restat = 1\n";
+ os << "restat = " << restat << "\n";
}
if(generator)
@@ -607,7 +607,7 @@ void cmGlobalNinjaGenerator::AddRule(const std::string& name,
const std::string& deptype,
const std::string& rspfile,
const std::string& rspcontent,
- bool restat,
+ const std::string& restat,
bool generator)
{
// Do not add the same rule twice.
@@ -1122,7 +1122,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
/*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
- /*restat=*/ false,
+ /*restat=*/ "",
/*generator=*/ true);
cmLocalNinjaGenerator *ng = static_cast<cmLocalNinjaGenerator *>(lg);
@@ -1206,7 +1206,7 @@ void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
/*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
- /*restat=*/ false,
+ /*restat=*/ "",
/*generator=*/ false);
WriteBuild(os,
"Clean all the built files.",
@@ -1229,7 +1229,7 @@ void cmGlobalNinjaGenerator::WriteTargetHelp(std::ostream& os)
/*deptype=*/ "",
/*rspfile=*/ "",
/*rspcontent*/ "",
- /*restat=*/ false,
+ /*restat=*/ "",
/*generator=*/ false);
WriteBuild(os,
"Print all primary targets available.",
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index a166938..3d443d8 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -125,7 +125,7 @@ public:
const std::string& deptype,
const std::string& rspfile,
const std::string& rspcontent,
- bool restat,
+ const std::string& restat,
bool generator);
/**
@@ -245,7 +245,7 @@ public:
const std::string& deptype,
const std::string& rspfile,
const std::string& rspcontent,
- bool restat,
+ const std::string& restat,
bool generator);
bool HasRule(const std::string& name);
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 0614ae7..48c4a2d 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -256,7 +256,7 @@ cmNinjaNormalTargetGenerator
/*deptype*/ "",
rspfile,
rspcontent,
- /*restat*/ false,
+ /*restat*/ "",
/*generator*/ false);
}
@@ -278,7 +278,7 @@ cmNinjaNormalTargetGenerator
/*deptype*/ "",
/*rspfile*/ "",
/*rspcontent*/ "",
- /*restat*/ false,
+ /*restat*/ "",
/*generator*/ false);
else
this->GetGlobalGenerator()->AddRule("CMAKE_SYMLINK_LIBRARY",
@@ -292,7 +292,7 @@ cmNinjaNormalTargetGenerator
/*deptype*/ "",
/*rspfile*/ "",
/*rspcontent*/ "",
- /*restat*/ false,
+ /*restat*/ "",
/*generator*/ false);
}
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 80213d8..57fbcd3 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -477,7 +477,7 @@ cmNinjaTargetGenerator
deptype,
/*rspfile*/ "",
/*rspcontent*/ "",
- /*restat*/ false,
+ /*restat*/ "",
/*generator*/ false);
}