summaryrefslogtreecommitdiffstats
path: root/Source/cmScanDepFormat.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-06-14 19:32:31 (GMT)
committerBrad King <brad.king@kitware.com>2021-06-15 12:48:05 (GMT)
commit2b9890e9b940db59b4d1633fa5b8067f615ed0f4 (patch)
treef0383f1491ff9da21aa1bd5d216f768e05fe6716 /Source/cmScanDepFormat.cxx
parent998fa490f4f9a3f6195f5383276be8e5ce8345c8 (diff)
downloadCMake-2b9890e9b940db59b4d1633fa5b8067f615ed0f4.zip
CMake-2b9890e9b940db59b4d1633fa5b8067f615ed0f4.tar.gz
CMake-2b9890e9b940db59b4d1633fa5b8067f615ed0f4.tar.bz2
cmScanDepFormat: Avoid writing lookup-method with default value
Diffstat (limited to 'Source/cmScanDepFormat.cxx')
-rw-r--r--Source/cmScanDepFormat.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmScanDepFormat.cxx b/Source/cmScanDepFormat.cxx
index 6620221..ae0e649 100644
--- a/Source/cmScanDepFormat.cxx
+++ b/Source/cmScanDepFormat.cxx
@@ -3,7 +3,6 @@
#include "cmScanDepFormat.h"
-#include <cassert>
#include <cctype>
#include <cstdio>
#include <utility>
@@ -339,7 +338,7 @@ bool cmScanDepFormat_P1689_Write(std::string const& path,
const char* lookup_method = nullptr;
switch (require.Method) {
case LookupMethod::ByName:
- lookup_method = "by-name";
+ // No explicit value needed for the default.
break;
case LookupMethod::IncludeAngle:
lookup_method = "include-angle";
@@ -348,8 +347,9 @@ bool cmScanDepFormat_P1689_Write(std::string const& path,
lookup_method = "include-quote";
break;
}
- assert(lookup_method);
- require_obj["lookup-method"] = lookup_method;
+ if (lookup_method) {
+ require_obj["lookup-method"] = lookup_method;
+ }
reqs.append(require_obj);
}