-
Notifications
You must be signed in to change notification settings - Fork 106
Qt header discovery & framework support; vendor simplecpp update #302
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 header discovery & framework support; vendor simplecpp update #302
Conversation
@jamesobutler Now this has been proposed upstream, we will be able to contribute |
@mrbean-bremen Thanks for the review 🙏 I will revisit and update shortly 🚀 |
…a4f49b (bfc53ad); was master (37fa4f4) Upstream: commontk/simplecpp@bfc53ad Source date: 2025-08-30 Files: generator/simplecpp/simplecpp.h, generator/simplecpp/simplecpp.cpp Patch: generator/simplecpp/do_not_stop_on_error.patch re-applied Compare: commontk/simplecpp@37fa4f4...bfc53ad
4c7ea5a
to
9a945d4
Compare
- Prefer `QLibraryInfo::{HeadersPath}` to locate Qt headers; fall back to `$QTDIR/include` when `QLibraryInfo` is unavailable or invalid. - Accept include roots from `PYTHONQT_INCLUDE` and `--include-paths`; warn and skip non-existent paths; normalize with `QDir::cleanPath`. - Probe module subdirs under the Qt include root and append those that exist (QtCore, QtGui, QtNetwork, QtOpenGL, QtXml). - Use `DUI::addIncludePath(...)` instead of pushing to `includePaths`. - Minor cleanups: Use QStringLiteral, add helpers for path joining/dir checks. Remove hardcoded macOS `/Library/Frameworks` header paths from the QTDIR-missing branch anticipating the addition of `getFrameworkDirectories` function.
9a945d4
to
b330ba7
Compare
… PYTHONQT_FRAMEWORK Add `getFrameworkDirectories` to collect framework/library search roots from: - `.` (cwd), - `PYTHONQT_FRAMEWORK` (path-list, validated), - `--framework-paths` CLI arg (validated), - `${QTDIR}/lib/<Module>` when present, plus `${QTDIR}/lib`. Co-authored-by: Hans Johnson <hans-johnson@uiowa.edu>
- Extend Qt version discovery to accept framework roots (e.g., .../QtCore.framework) in addition to include dirs. - On macOS, also probe `Versions/A/Headers/qtcoreversion.h`. - Try include paths first, then framework paths; abort with a clear error if neither yields a version. Co-authored-by: Hans Johnson <hans-johnson@uiowa.edu>
…generated on macOS
This improves header file detection on macOS by introducing support for additional common paths where `qtcoreversion.h` might be located. This change enhances compatibility with different Qt installations.
9689614
to
dd42ec8
Compare
@mrbean-bremen This now ready for final review & integration 🙏 🚀 |
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.
Very nice - thank you!
This PR modernizes how the generator discovers Qt headers/frameworks and vendors a newer
simplecpp
with framework-aware search logic. Together these changes make builds robust on macOS (Qt frameworks) and cleaner across all platforms.Vendor
simplecpp
updateBumps
generator/simplecpp/{simplecpp.h, simplecpp.cpp}
to patched-2025-08-30-37fa4f49b (upstream: commontk/simplecpp@bfc53ad; previously danmar/simplecpp@37fa4f4).Re-applies local patch:
generator/simplecpp/do_not_stop_on_error.patch
.Introduces a typed, ordered search path API:
DUI::PathKind { Include, SystemInclude, Framework, SystemFramework }
DUI::searchPaths
plus helpersaddIncludePath
,addSystemIncludePath
,addFrameworkPath
,addSystemFrameworkPath
searchPaths
is empty, legacyincludePaths
is mirrored asInclude
.Adds Apple framework resolution for
#include <Pkg/Hdr.h>
→<Pkg.framework/Headers/Hdr.h>
(andPrivateHeaders
fallback).Interleaves
-I
and-F
in the original CLI order; handles-isystem
and-iframework
.Upstream compare: commontk/simplecpp@37fa4f4...bfc53ad
Note
This changes are vendored from the
commontk/simplecpp
fork including commit backported from:-I
,-isystem
,-F
,-iframework
+ Darwin framework support (with legacy-I
back-compat) danmar/simplecpp#511Generator: discover Qt headers via
QLibraryInfo
Prefers
QLibraryInfo::HeadersPath
; falls back to$QTDIR/include
if needed.Accepts include roots from:
PYTHONQT_INCLUDE
(path list; validated)--include-paths
(validated)Probes and appends existing module subdirs under the Qt include root:
QtCore
,QtGui
,QtNetwork
,QtOpenGL
,QtXml
.Starts using
DUI::addIncludePath(...)
instead of pushing to the legacyincludePaths
.Removes hardcoded macOS
/Library/Frameworks/.../Headers
assumptions (to defer to new framework discovery).Generator: discover Qt framework paths dynamically (macOS)
New
getFrameworkDirectories(...)
collects framework/library search roots from:.
(cwd)PYTHONQT_FRAMEWORK
(validated)--framework-paths
(validated)${QTDIR}/lib/<Module>.framework
when present, plus${QTDIR}/lib
QLibraryInfo::LibrariesPath
when availablePasses these paths to the preprocessor using
DUI::addFrameworkPath(...)
.Generator: detect Qt version from frameworks on macOS
getQtVersion(...)
now accepts either header include directories or framework roots.Versions/A/Headers/qtcoreversion.h
when given a framework root (e.g.,.../QtCore.framework
).This pull request supersedes the following ones:
This pull request fixes the following issues: