summaryrefslogtreecommitdiffstats
path: root/Source/cmTransformDepfile.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-01-16 13:04:05 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-01-16 15:21:12 (GMT)
commit0b65a2b2531b05abe1bc1f1950bb963af7a6d42f (patch)
treef030499394a3dd427ff56f1d30424307254ef705 /Source/cmTransformDepfile.cxx
parente04a352cca523eba2ac0d60063a3799f5bb1c69e (diff)
downloadCMake-0b65a2b2531b05abe1bc1f1950bb963af7a6d42f.zip
CMake-0b65a2b2531b05abe1bc1f1950bb963af7a6d42f.tar.gz
CMake-0b65a2b2531b05abe1bc1f1950bb963af7a6d42f.tar.bz2
add_custom_command(DEPFILE): ensure all dependencies are taken into account
Diffstat (limited to 'Source/cmTransformDepfile.cxx')
-rw-r--r--Source/cmTransformDepfile.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/cmTransformDepfile.cxx b/Source/cmTransformDepfile.cxx
index 4032596..81a6507 100644
--- a/Source/cmTransformDepfile.cxx
+++ b/Source/cmTransformDepfile.cxx
@@ -4,7 +4,6 @@
#include <algorithm>
#include <functional>
-#include <memory>
#include <string>
#include <type_traits>
#include <utility>
@@ -95,14 +94,16 @@ void WriteMSBuildAdditionalInputs(cmsys::ofstream& fout,
// Write the format expected by MSBuild CustomBuild AdditionalInputs.
const char* sep = "";
- for (std::string path : content.front().paths) {
- if (!cmSystemTools::FileIsFullPath(path)) {
- path =
- cmSystemTools::CollapseFullPath(path, lg.GetCurrentBinaryDirectory());
+ for (const auto& c : content) {
+ for (std::string path : c.paths) {
+ if (!cmSystemTools::FileIsFullPath(path)) {
+ path = cmSystemTools::CollapseFullPath(path,
+ lg.GetCurrentBinaryDirectory());
+ }
+ std::replace(path.begin(), path.end(), '/', '\\');
+ fout << sep << path;
+ sep = ";";
}
- std::replace(path.begin(), path.end(), '/', '\\');
- fout << sep << path;
- sep = ";";
}
fout << "\n";
}