summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorCajus Pollmeier <pollmeier@gonicus.de>2023-12-14 14:16:18 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-12-19 20:18:32 +0000
commit493c596a6cfee36209f09bf9dde9e9226687653b (patch)
tree3b10a8f1dc4ac590f4e8f0ec961e3a2574e21c56 /cmake
parentca977a1c65870b931d11a402f887e26cd7b30c32 (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 Change-Id: I24971b3bc83ea05841dae21667fbbae3416cfcf9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit e7457ff171255148d92254316433d39ef1bd3d28) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit fa41643a7edc89f035ea63d024b68fb7dd585a15)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseConfigureTests.cmake2
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}")