Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

redstrate
Copy link
Contributor

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

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
@redstrate redstrate self-assigned this Jan 16, 2025
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e84662a) to head (32a4c12).

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.
📢 Have feedback on the report? Share it here.

@redstrate redstrate added the 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo label Jan 16, 2025
@@ -489,6 +489,10 @@ impl QtBuild {
};

for qt_module in &self.qt_modules {
if qt_module.contains("Private") {
Copy link
Collaborator

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") {
Copy link
Collaborator

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 ?

@ahayzen-kdab
Copy link
Collaborator

Looks great overall, just some small questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add private include paths
2 participants