diff options
author | Cajus Pollmeier <pollmeier@gonicus.de> | 2023-12-14 14:16:18 +0100 |
---|---|---|
committer | Cajus Pollmeier <pollmeier@gonicus.de> | 2023-12-19 12:01:04 +0100 |
commit | e7457ff171255148d92254316433d39ef1bd3d28 (patch) | |
tree | bbd3c2acdbd162a0adcd3fe27c964f45f19ad571 /cmake/QtBaseConfigureTests.cmake | |
parent | f3fb89ba298e1741320d8bfac9cbd0d503373bff (diff) |
Fix CMake extraction of sub architecture test
The length check is hard coded to the length of the string under test.
As the STRINGS match only filters out non printable characters, we've
no guarantee that the characters before the == position are printable
or not. So _pos may be > 1 and then string length check will be broken.
Replaced this by a pattern match to see whether there's something after
the ":".
Fixes: QTBUG-120125
Pick-to: 6.5 6.6 6.7
Change-Id: I24971b3bc83ea05841dae21667fbbae3416cfcf9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtBaseConfigureTests.cmake')
-rw-r--r-- | cmake/QtBaseConfigureTests.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtBaseConfigureTests.cmake b/cmake/QtBaseConfigureTests.cmake index b62eec8410..7713def6bf 100644 --- a/cmake/QtBaseConfigureTests.cmake +++ b/cmake/QtBaseConfigureTests.cmake @@ -73,7 +73,7 @@ function(qt_run_config_test_architecture) string(SUBSTRING "${_line}" ${_pos} -1 _architecture) endif() string(FIND "${_line}" "==Qt=magic=Qt== Sub-architecture:" _pos) - if (_pos GREATER -1 AND ${lineLength} GREATER 33) + if (_pos GREATER -1 AND NOT _line MATCHES "Sub-architecture:$") math(EXPR _pos "${_pos}+34") string(SUBSTRING "${_line}" ${_pos} -1 _sub_architecture) string(REPLACE " " ";" _sub_architecture "${_sub_architecture}") |