-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qt-build-utils: Add support for including headers from private modules #1160
base: main
Are you sure you want to change the base?
Conversation
This allows you to include headers from private modules, e.g. "qpa/qplatformnativeinterface.h" from GuiPrivate. It does this by adding a special case for these modules, and appends the correct path. Fixes KDAB#955
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1160 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 71 71
Lines 11967 11967
=========================================
Hits 11967 11967 ☔ View full report in Codecov by Sentry. |
@@ -489,6 +489,10 @@ impl QtBuild { | |||
}; | |||
|
|||
for qt_module in &self.qt_modules { | |||
if qt_module.contains("Private") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment explaining how Private does not have a separate library and is just the normal library name.
I assume there is not a usecase of only putting like CorePrivate and not Core ? As this code currently requires you to specify the modules Core and CorePrivate, is this the same behaviour as with CMake ?
@@ -562,13 +566,19 @@ impl QtBuild { | |||
let lib_path = self.qmake_query("QT_INSTALL_LIBS"); | |||
let mut paths = Vec::new(); | |||
for qt_module in &self.qt_modules { | |||
// Add the usual location for the Qt module | |||
paths.push(format!("{root_path}/Qt{qt_module}")); | |||
if qt_module.contains("Private") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the module name always end with private ? as we could use .ends_with
for these checks too ?
Looks great overall, just some small questions |
This allows you to include headers from private modules, e.g. "qpa/qplatformnativeinterface.h" from GuiPrivate. It does this by adding a special case for these modules, and appends the correct path.
Fixes #955