Skip to content

qt-build-utils: Add support for including headers from private modules#1160

Open
redstrate wants to merge 1 commit into
KDAB:mainfrom
redstrate:work/josh/private-headers
Open

qt-build-utils: Add support for including headers from private modules#1160
redstrate wants to merge 1 commit into
KDAB:mainfrom
redstrate:work/josh/private-headers

Conversation

@redstrate

Copy link
Copy Markdown
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
@codecov

codecov Bot commented Jan 16, 2025

Copy link
Copy Markdown

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
};

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

Copy link
Copy Markdown
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 ?

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
Copy Markdown
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
Copy Markdown
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