mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-20 12:53:55 +08:00
cmScanDepFormat: Avoid writing lookup-method with default value
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include "cmScanDepFormat.h"
|
#include "cmScanDepFormat.h"
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@@ -339,7 +338,7 @@ bool cmScanDepFormat_P1689_Write(std::string const& path,
|
|||||||
const char* lookup_method = nullptr;
|
const char* lookup_method = nullptr;
|
||||||
switch (require.Method) {
|
switch (require.Method) {
|
||||||
case LookupMethod::ByName:
|
case LookupMethod::ByName:
|
||||||
lookup_method = "by-name";
|
// No explicit value needed for the default.
|
||||||
break;
|
break;
|
||||||
case LookupMethod::IncludeAngle:
|
case LookupMethod::IncludeAngle:
|
||||||
lookup_method = "include-angle";
|
lookup_method = "include-angle";
|
||||||
@@ -348,8 +347,9 @@ bool cmScanDepFormat_P1689_Write(std::string const& path,
|
|||||||
lookup_method = "include-quote";
|
lookup_method = "include-quote";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert(lookup_method);
|
if (lookup_method) {
|
||||||
require_obj["lookup-method"] = lookup_method;
|
require_obj["lookup-method"] = lookup_method;
|
||||||
|
}
|
||||||
|
|
||||||
reqs.append(require_obj);
|
reqs.append(require_obj);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user