summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6CoreMacros.cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-05-12 14:57:23 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-05-15 11:47:09 +0200
commit0cdcbb40a1f7fe0288698898027717959f4fbee1 (patch)
treec8f69d9d90a30f388f70e08b44eac960ea4f5b25 /src/corelib/Qt6CoreMacros.cmake
parentd5cb44cd3a2169d7c479d1f53d69544b9109f003 (diff)
CMake: Enable default usage of utf8 sources for Qt consumers
And enable the same default when building Qt itself (it's implicit). Allow opting out on a target-by-target basis, by using the public qt_disable_utf8_sources() API call. Change-Id: Ifc19a744d57b96b1c74a6926a0c6628c2a820464 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/Qt6CoreMacros.cmake')
-rw-r--r--src/corelib/Qt6CoreMacros.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/Qt6CoreMacros.cmake b/src/corelib/Qt6CoreMacros.cmake
index c4ccd04c60..53a6405aed 100644
--- a/src/corelib/Qt6CoreMacros.cmake
+++ b/src/corelib/Qt6CoreMacros.cmake
@@ -1257,3 +1257,10 @@ if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
endif()
endfunction()
endif()
+
+# By default Qt6 forces usage of utf8 sources for consumers of Qt.
+# Users can opt out of utf8 sources by calling this function with the target name of their
+# application or library.
+function(qt_disable_utf8_sources target)
+ set_target_properties("${target}" PROPERTIES QT_NO_UTF8_SOURCE TRUE)
+endfunction()