cmake: fix crosstool-NG version check regex
This commit is contained in:
parent
2c55fae6cf
commit
2557442ae9
1 changed files with 4 additions and 4 deletions
|
@ -12,11 +12,11 @@ endfunction()
|
||||||
|
|
||||||
function(crosstool_version_check expected_ctng_version)
|
function(crosstool_version_check expected_ctng_version)
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_C_COMPILER} -v
|
COMMAND ${CMAKE_C_COMPILER} --version
|
||||||
ERROR_VARIABLE toolchain_stderr
|
OUTPUT_VARIABLE toolchain_version
|
||||||
OUTPUT_QUIET)
|
ERROR_QUIET)
|
||||||
|
|
||||||
string(REGEX MATCH "crosstool-ng-[0-9a-g\\.-]+" ctng_version "${toolchain_stderr}")
|
string(REGEX REPLACE ".*(crosstool-NG ([^\)]+)).*\n" "\\2" ctng_version "${toolchain_version}")
|
||||||
# We use FIND to match version instead of STREQUAL because some toolchains are built
|
# We use FIND to match version instead of STREQUAL because some toolchains are built
|
||||||
# with longer git hash strings than others. This will match any version which starts with
|
# with longer git hash strings than others. This will match any version which starts with
|
||||||
# the expected version string.
|
# the expected version string.
|
||||||
|
|
Loading…
Reference in a new issue