From 2c2c9ce080ea33344bcf87423156f1b29ea4f993 Mon Sep 17 00:00:00 2001 From: tison Date: Tue, 25 Oct 2022 19:04:28 +0800 Subject: [PATCH] fix: properly parse cmake version This closes #1042. Signed-off-by: tison --- x.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x.py b/x.py index 99d3e5e8cb3..2a7cc45522b 100755 --- a/x.py +++ b/x.py @@ -95,7 +95,7 @@ def build(dir: str, jobs: int, ghproxy: bool, ninja: bool, unittest: bool, compi output = run_pipe(cmake, "-version") output = run_pipe("head", "-n", "1", stdin=output) - output = run_pipe("sed", "s/[^0-9.]*//g", stdin=output) + output = run_pipe("awk", "{print $(NF)}", stdin=output) cmake_version = output.read().strip() check_version(cmake_version, CMAKE_REQUIRE_VERSION, "CMake")