diff options
author | Martin Storsjö <[email protected]> | 2024-04-09 15:38:02 +0300 |
---|---|---|
committer | Qt Cherry-pick Bot <[email protected]> | 2024-04-11 21:44:42 +0000 |
commit | 633216f288df4748d2b664580f5a1b1b7b2de9bc (patch) | |
tree | d24aa0b2b6c5b2d5823b56c5c486dd7c4dc50969 | |
parent | 6bb5130c38338af8e22cbc54520f33d4c9dbf1f9 (diff) |
CMake: Fix a misplaced > in pkg-config files
The Qt CMake routines for generating pkg-config files don't
handle all sorts of generator expressions, see
qt_internal_set_pkg_config_cpp_flags in QtPkgConfigHelpers.cmake
which hardcodes handling of some specific expressions. In this
case, they don't handle the semicolon within the generator
expression expansion.
For the UNICODE and _UNICODE defines, this means that the pkg-config
file ends up containing "-D_UNICODE>" with the trailing ">". (The
pkg-config generator tries to parse out the generator expressions,
but the semicolon gets handled as a higher level separator, leaving
the closing bracket ">" behind.)
This issue only shows up for mingw targets, because pkg-config files
aren't generated in MSVC style builds.
Escape the semicolon as $<SEMICOLON> to make it not break the
surrounding generator expression, as parsed by the pkg-config file
generator.
The generator expressions aren't fully correctly evaluated for the
pkg-config files though; the UNICODE and _UNICODE defines don't
end up in the resulting pkg-config file even though they're used
during compilation (both before and after this change).
Fixes: QTBUG-103019
Co-authored-by: Martin Reboredo <[email protected]>
Pick-to: 6.2
Change-Id: Icdb380e3b42be2a47372a8ee2b61378a33c685f7
Reviewed-by: Alexey Edelev <[email protected]>
Reviewed-by: Li Xinwei <[email protected]>
(cherry picked from commit f35b9530b9acf954f8741d0ee2b4b68fc90a4afc)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
(cherry picked from commit 3890c487e9784671ef7ce7928b55e2314adce457)
-rw-r--r-- | cmake/QtFlagHandlingHelpers.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake index 91e1de86445..cdbaaacad4d 100644 --- a/cmake/QtFlagHandlingHelpers.cmake +++ b/cmake/QtFlagHandlingHelpers.cmake @@ -365,7 +365,7 @@ function(qt_internal_enable_unicode_defines) set(no_unicode_condition "$<NOT:$<BOOL:$<TARGET_PROPERTY:QT_NO_UNICODE_DEFINES>>>") target_compile_definitions(Platform - INTERFACE "$<${no_unicode_condition}:UNICODE;_UNICODE>") + INTERFACE "$<${no_unicode_condition}:UNICODE$<SEMICOLON>_UNICODE>") endif() endfunction() |