diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2020-12-15 09:13:41 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2020-12-23 13:40:19 (GMT) |
commit | a526f71266c2fed017c65a3d90b63286221476c0 (patch) | |
tree | c0aa8bd13b3965480efbd31b5b6c03fd87640970 /Source/cmTransformDepfile.cxx | |
parent | 8c9c338e5e297020df0b5cdf9443beef245513de (diff) | |
download | CMake-a526f71266c2fed017c65a3d90b63286221476c0.zip CMake-a526f71266c2fed017c65a3d90b63286221476c0.tar.gz CMake-a526f71266c2fed017c65a3d90b63286221476c0.tar.bz2 |
cmGccDepfileReader: Add new function ensuring paths are valid
And cmTransformDepfile now rely on this new function.
Diffstat (limited to 'Source/cmTransformDepfile.cxx')
-rw-r--r-- | Source/cmTransformDepfile.cxx | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/Source/cmTransformDepfile.cxx b/Source/cmTransformDepfile.cxx index 163d7e0..b91e1ce 100644 --- a/Source/cmTransformDepfile.cxx +++ b/Source/cmTransformDepfile.cxx @@ -13,7 +13,6 @@ #include "cmGccDepfileReader.h" #include "cmGccDepfileReaderTypes.h" -#include "cmStringAlgorithms.h" #include "cmSystemTools.h" namespace { @@ -79,26 +78,13 @@ bool cmTransformDepfile(cmDepfileFormat format, const std::string& prefix, { cmGccDepfileContent content; if (cmSystemTools::FileExists(infile)) { - auto result = cmReadGccDepfile(infile.c_str()); + auto result = cmReadGccDepfile(infile.c_str(), prefix); if (!result) { return false; } content = *std::move(result); } - for (auto& dep : content) { - for (auto& rule : dep.rules) { - if (!cmSystemTools::FileIsFullPath(rule)) { - rule = cmStrCat(prefix, rule); - } - } - for (auto& path : dep.paths) { - if (!cmSystemTools::FileIsFullPath(path)) { - path = cmStrCat(prefix, path); - } - } - } - cmsys::ofstream fout(outfile.c_str()); if (!fout) { return false; |