diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-05-21 10:22:04 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-05-21 16:05:44 +0200 |
commit | 715041b663ababa8b36f90978d20bdcdd80e3117 (patch) | |
tree | 6482cf74c32d6b01f37bcef1bf40537078bc396f /src | |
parent | f1983dcdf6c596f901694ad16dcd3c74c77f4c13 (diff) |
Enable UNICODE for all Qt targets and Qt consumers by default
After discussion we decided to opt-out the UNICODE definintion
behavior. To disable UNICODE in user projects the
qt6_disable_unicode_defines function could be used.
Amends 5b64e5950cf984abb7d47e0802bcb4b5a21e06fa
[ChangeLog][CMake] Enables the UNICODE and _UNICODE definitions on
WIN32 platforms by default for all cmake projects to reflect the
qmake behavior. Use qt6_disable_unicode_defines function to disable
the default unicode definitions.
Pick-to: 6.1
Fixes: QTBUG-93895
Change-Id: Id70ff7dcf8c74f660ec851f8b950e1e3b94d9fb4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/Qt6CoreMacros.cmake | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake index 96b25b4ad9..2fd6d3a18c 100644 --- a/src/corelib/Qt6CoreMacros.cmake +++ b/src/corelib/Qt6CoreMacros.cmake @@ -1884,3 +1884,14 @@ properties of both types." ) endforeach() endfunction() + +# Disables the default unicode definitions for the target +function(qt6_disable_unicode_defines target) + set_target_properties(${target} PROPERTIES QT_NO_UNICODE_DEFINES TRUE) +endfunction() + +if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS) + function(qt_disable_unicode_defines) + qt6_disable_unicode_defines(${ARGV}) + endfunction() +endif() |