summaryrefslogtreecommitdiffstats
path: root/Source/cmGccDepfileReader.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGccDepfileReader.cxx')
-rw-r--r--Source/cmGccDepfileReader.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/cmGccDepfileReader.cxx b/Source/cmGccDepfileReader.cxx
index 9d70ede..eb3511a 100644
--- a/Source/cmGccDepfileReader.cxx
+++ b/Source/cmGccDepfileReader.cxx
@@ -5,14 +5,15 @@
#include <type_traits>
#include <utility>
+#include <cm/optional>
+
#include "cmGccDepfileLexerHelper.h"
-cmGccDepfileContent cmReadGccDepfile(const char* filePath)
+cm::optional<cmGccDepfileContent> cmReadGccDepfile(const char* filePath)
{
- cmGccDepfileContent result;
cmGccDepfileLexerHelper helper;
if (helper.readFile(filePath)) {
- result = std::move(helper).extractContent();
+ return cm::make_optional(std::move(helper).extractContent());
}
- return result;
+ return cm::nullopt;
}