qt-build-utils: Add support for including headers from private modules#1160
qt-build-utils: Add support for including headers from private modules#1160
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. |
| }; | ||
|
|
||
| for qt_module in &self.qt_modules { | ||
| if qt_module.contains("Private") { |
There was a problem hiding this comment.
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 ?
| 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.
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