summaryrefslogtreecommitdiffstats
path: root/Source/cmGccDepfileReader.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-01-06 12:52:53 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-01-09 10:35:00 (GMT)
commit8ec7408d745a9e17a1e35a4e97e9ab33044832c9 (patch)
tree7eecc261db167be34f52ce087e61dc3e38e1167b /Source/cmGccDepfileReader.cxx
parentce874fbcd6350225ce854a984efd34caf78c3e0f (diff)
downloadCMake-8ec7408d745a9e17a1e35a4e97e9ab33044832c9.zip
CMake-8ec7408d745a9e17a1e35a4e97e9ab33044832c9.tar.gz
CMake-8ec7408d745a9e17a1e35a4e97e9ab33044832c9.tar.bz2
Makefile dependencies: ensure long paths are used on Windows
Diffstat (limited to 'Source/cmGccDepfileReader.cxx')
-rw-r--r--Source/cmGccDepfileReader.cxx23
1 files changed, 8 insertions, 15 deletions
diff --git a/Source/cmGccDepfileReader.cxx b/Source/cmGccDepfileReader.cxx
index 96a562e..8253375 100644
--- a/Source/cmGccDepfileReader.cxx
+++ b/Source/cmGccDepfileReader.cxx
@@ -12,40 +12,33 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
-cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath)
-{
- cmGccDepfileLexerHelper helper;
- if (helper.readFile(filePath)) {
- return cm::make_optional(std::move(helper).extractContent());
- }
- return cm::nullopt;
-}
-
cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath,
const std::string& prefix)
{
- auto deps = cmReadGccDepfile(filePath);
-
- if (prefix.empty() || !deps) {
- return deps;
+ cmGccDepfileLexerHelper helper;
+ if (!helper.readFile(filePath)) {
+ return cm::nullopt;
}
+ auto deps = cm::make_optional(std::move(helper).extractContent());
for (auto& dep : *deps) {
for (auto& rule : dep.rules) {
- if (!cmSystemTools::FileIsFullPath(rule)) {
+ if (!prefix.empty() && !cmSystemTools::FileIsFullPath(rule)) {
rule = cmStrCat(prefix, rule);
}
if (cmSystemTools::FileIsFullPath(rule)) {
rule = cmSystemTools::CollapseFullPath(rule);
}
+ cmSystemTools::ConvertToLongPath(rule);
}
for (auto& path : dep.paths) {
- if (!cmSystemTools::FileIsFullPath(path)) {
+ if (!prefix.empty() && !cmSystemTools::FileIsFullPath(path)) {
path = cmStrCat(prefix, path);
}
if (cmSystemTools::FileIsFullPath(path)) {
path = cmSystemTools::CollapseFullPath(path);
}
+ cmSystemTools::ConvertToLongPath(path);
}
}