summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-25 17:26:44 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-25 18:36:30 (GMT)
commit6e2a4087f2ff93fcea8391963a4101fce52ee94d (patch)
tree29b04b188382fcc8411b799e2d788e83c8f78ee0 /Source/cmLocalNinjaGenerator.h
parent993d064197b36de9e18131afc4ace753b8570d0b (diff)
downloadCMake-6e2a4087f2ff93fcea8391963a4101fce52ee94d.zip
CMake-6e2a4087f2ff93fcea8391963a4101fce52ee94d.tar.gz
CMake-6e2a4087f2ff93fcea8391963a4101fce52ee94d.tar.bz2
Ninja: Centralize path conversion in global generator (#15757)
In the Ninja generator we run all build rules from the top of the build tree rather than changing into each subdirectory. Therefore we convert all paths relative to the HOME_OUTPUT directory. However, the Convert method on cmLocalGenerator restricts relative path conversions to avoid leaving the build tree with a "../" sequence. Therefore conversions performed for "subdirectories" that are outside the top of the build tree always use full paths while conversions performed for subdirectories that are inside the top of the build tree may use relative paths to refer to the same files. Since Ninja always runs rules from the top of the build tree we should convert them using only the top-level cmLocalGenerator in order to remain consistent. Also extend the test suite with a case that fails without this fix.
Diffstat (limited to 'Source/cmLocalNinjaGenerator.h')
-rw-r--r--Source/cmLocalNinjaGenerator.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 8d3d49c..1645a8d 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -50,21 +50,6 @@ public:
std::string GetHomeRelativeOutputPath() const
{ return this->HomeRelativeOutputPath; }
- std::string ConvertToNinjaPath(const std::string& path);
-
- struct map_to_ninja_path {
- cmLocalNinjaGenerator *LocalGenerator;
- map_to_ninja_path(cmLocalNinjaGenerator *LocalGen)
- : LocalGenerator(LocalGen) {}
- std::string operator()(const std::string &path) {
- return LocalGenerator->ConvertToNinjaPath(path);
- }
- };
-
- map_to_ninja_path MapToNinjaPath() {
- return map_to_ninja_path(this);
- }
-
void ExpandRuleVariables(std::string& string,
const RuleVariables& replaceValues) {
cmLocalGenerator::ExpandRuleVariables(string, replaceValues);