From 624891e7c529e7dd94a26c1786e785a26953e918 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 4 Jun 2019 14:01:39 +0200 Subject: [PATCH] Fix build with clang 8.0 When qt_parse_version_string tries to parse the compiler version into separate fields, it tries to accommodate for different number of digits separate by dots by checking the length of the list as it is mutated. Unfortunately the length variable is not a live variable, so after removing an entry from the list we must change the length variable manually. Change-Id: Ieaeb091581484e8c723fbb467697f73036e64ec9 Reviewed-by: Leander Beernaert Reviewed-by: Alexandru Croitor --- cmake/QtPlatformSupport.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake index 2468932179..ac9973905a 100644 --- a/cmake/QtPlatformSupport.cmake +++ b/cmake/QtPlatformSupport.cmake @@ -49,6 +49,7 @@ function(qt_parse_version_string version_string out_var_prefix) if(length GREATER 0) list(GET version_list 0 value) list(REMOVE_AT version_list 0) + math(EXPR length "${length}-1") endif() set(${out_var} "${value}" PARENT_SCOPE) @@ -58,6 +59,7 @@ function(qt_parse_version_string version_string out_var_prefix) list(GET version_list 0 value) set(${out_var} "${value}" PARENT_SCOPE) list(REMOVE_AT version_list 0) + math(EXPR length "${length}-1") endif() set(${out_var} "${value}" PARENT_SCOPE) @@ -67,7 +69,7 @@ function(qt_parse_version_string version_string out_var_prefix) list(GET version_list 0 value) set(${out_var} "${value}" PARENT_SCOPE) list(REMOVE_AT version_list 0) - + math(EXPR length "${length}-1") endif() set(${out_var} "${value}" PARENT_SCOPE) endfunction()