summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-03-21 10:07:03 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-03-21 21:13:57 -0700
commite0940081bc7439d87d9ca41402a543a9c17fb857 (patch)
tree40bc6ea1f50bb8903a918dd9dc71c8a3a81ead01
parentf4bac3ca173be9f219099c04e76d6d62c4d0e19e (diff)
CMake/ELF: allow using Qt's full version number in the private tags
We added the feature to tag private symbols using the Qt major version only, because us developers often move between versions and need to keep compiled code working, even when using private API (we're supposed to know what we're doing). Linux distributions, however, want to be told that something used private API and therefore needs to be rebuilt. See [1][2][3]. Distributors will learn about this feature when updating Qt causes the existing patch to fail to apply. [1] https://build.opensuse.org/projects/openSUSE:Factory/packages/qt6-base/files/0001-Tell-the-truth-about-private-API.patch?expand=1 [2] https://src.fedoraproject.org/rpms/qt6-qtbase/blob/rawhide/f/qtbase-tell-the-truth-about-private-API.patch [3] https://github.com/clearlinux-pkgs/qtbase/blob/main/tell-the-truth-about-private-api.patch Pick-to: 6.7 Change-Id: I5f663c2f9f4149af84fefffd17bed69026f4038d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake6
-rw-r--r--configure.cmake6
2 files changed, 11 insertions, 1 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index 28231cb564..32ce929e45 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -69,7 +69,11 @@ function(qt_internal_add_linker_version_script target)
endforeach()
endforeach()
- string(APPEND contents "\n};\nQt_${PROJECT_VERSION_MAJOR}_PRIVATE_API { qt_private_api_tag*;\n")
+ string(APPEND contents "\n};\nQt_${PROJECT_VERSION_MAJOR}")
+ if(QT_FEATURE_elf_private_full_version)
+ string(APPEND contents ".${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
+ endif()
+ string(APPEND contents "_PRIVATE_API { qt_private_api_tag*;\n")
if(arg_PRIVATE_HEADERS)
foreach(ph ${arg_PRIVATE_HEADERS})
string(APPEND contents " @FILE:${ph}@\n")
diff --git a/configure.cmake b/configure.cmake
index caa1366ea2..d99e2c0afe 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -611,6 +611,12 @@ qt_feature("rpath" PUBLIC
CONDITION BUILD_SHARED_LIBS AND UNIX AND NOT WIN32 AND NOT ANDROID
)
qt_feature_config("rpath" QMAKE_PUBLIC_QT_CONFIG)
+qt_feature("elf_private_full_version" PRIVATE
+ LABEL "Use Qt's full version number in ELF version symbols"
+ AUTODETECT OFF
+ CONDITION BUILD_SHARED_LIBS AND UNIX AND NOT APPLE
+)
+qt_feature_config("elf_private_full_version" QMAKE_PRIVATE_QT_CONFIG)
qt_feature("force_asserts" PUBLIC
LABEL "Force assertions"
AUTODETECT OFF