Skip to content

Commit a4da640

Browse files
rossburtoncfriedt
authored andcommitted
cmake: expand DTC version regex
DTC can be built with both traditional Makefiles or Meson. When built with Makefiles the --version output looks like 'Version: DTC 1.6.1-dirty' but when built with Meson the output is 'Version: DTC v1.6.1+. This fails to match the version regex and the cmake then fails: CMake Error at cmake/host-tools.cmake:28 (if): if given arguments: "VERSION_GREATER" "1.4.6" Unknown arguments specified Expanding the regex with an optional 'v' covers both cases and the build succeeds. Signed-off-by: Ross Burton <[email protected]>
1 parent 46de74b commit a4da640

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/host-tools.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if(DTC)
2020
)
2121

2222
if(${dtc_status} EQUAL 0)
23-
string(REGEX MATCH "Version: DTC ([0-9]+[.][0-9]+[.][0-9]+).*" out_var ${dtc_version_output})
23+
string(REGEX MATCH "Version: DTC v?([0-9]+[.][0-9]+[.][0-9]+).*" out_var ${dtc_version_output})
2424

2525
# Since it is optional, an outdated version is not an error. If an
2626
# outdated version is discovered, print a warning and proceed as if

0 commit comments

Comments
 (0)