summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-03-21 10:07:03 -0700
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-22 04:14:07 +0000
commitbccbdc225505eb39458336922fa30f87fd81476a (patch)
tree5cda4e60223014a660f8f8089a8decc8655fbc8d /cmake
parentd96653f559175f42da36ad5f590a113121368e65 (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 Change-Id: I5f663c2f9f4149af84fefffd17bed69026f4038d Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit e0940081bc7439d87d9ca41402a543a9c17fb857) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake6
1 files changed, 5 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")