Check if next property in the list is not empty before adding a comma

Property merging genex only checks if previous value is not empty, but
doesn't check if an actual value that we concatenate is not empty too.
Add the check to make sure we don't have trailing comma in the json
lists.

Fixes: QTBUG-112885
Pick-to: 6.5
Change-Id: I1a5265ddf1b12f763650daf3c6e3538ed52a1674
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Alexey Edelev 2023-04-26 10:55:24 +02:00
parent 2550568a92
commit a3cb388eaa

View File

@ -840,6 +840,9 @@ function(_qt_internal_add_android_deployment_list_property out_var json_key)
set(add_quote_genex
"$<$<BOOL:${property_genex}>:\">"
)
# Add comma only if next property genex contains non-empty value.
set(add_comma_genex "$<$<BOOL:${property_genex}>:${add_comma_genex}>")
string(JOIN "" list_join_genex
"${list_join_genex}"
"${add_comma_genex}${add_quote_genex}"