Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix includes for framework libs #630
fix includes for framework libs #630
Changes from all commits
4159acf
80e0120
1ebdd64
cafdd3c
577df64
6fda61b
cdf2478
cfff8bc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is this correct when Qt is installed as a framework? This allows using include paths like
#include <QString>
instead of#include <QtCore/QString>
. Should we skip this part for frameworks?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.
I never included using
#include <QtCore/QString>
, always using#include <QString>
like it's shown in the Qt documentation. So, I don't see the problem. Or I misunderstand your comment ?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.
I think this code should likely be moved into an
else
block of theif self.has_framework_libs
statement. If it wasn't sufficient before to get the include paths with frameworks, it's probably okay to not add these include paths when using frameworks.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.
I did a few researches :
The module-style includes (
#include <QObject>
)are essential in MacOS framework style. Using the old #include <QtCore/qobject.h> or #include <QtCore/QObject> is not possible any longer. The old style still runs well on Windows and Linux thought.I was testing only on qml_minimal example project, so this problem didn't appear.
On a hunch, I ran
QMAKE=/Users/cyril/Qt/6.5.2/macos/bin/qmake cargo run -p qml-minimal-no-cmake
, so Qt's official install on MacOs with framework styleIt gave me these errors:
cargo:warning=In file included from /Users/cyril/Devel/cxx-qt/target/debug/build/cxx-qt-lib-c19809693f328b69/out/cxxbridge/sources/cxx-qt-lib/src/core/qlist/qlist_i32.rs.cc:1:
cargo:warning=/Users/cyril/Devel/cxx-qt/target/debug/build/cxx-qt-lib-c19809693f328b69/out/cxx-qt-lib/qlist.h:11:10: fatal error: 'QtCore/QList' file not found
cargo:warning=#include <QtCore/QList>
cargo:warning= ^~~~~~~~~~~~~~
cargo:warning=1 error generated.
exit status: 1
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.
Huh curious, i found doing
#include <QtCore/QObject>
useful as it allows you to quickly determine which modules you need to include and link or why a library needs eg QtQuick as you can search for it quickly.Guess we'll have to drop doing that if this doesn't work in macOS anymore (i can create a separate PR to do this), unless there is a different include folder that can be used that does include the module name + the header name ?
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.
I looked at the CI output from another projecting using the Qt official binary installer and the include paths are:
So it seems we need:
Please try that code with both
#include <QString>
and#include <QtCore/QString>
style includes.I also saw
-isystem /Users/build/Qt/online/6.3.2/macos/include
in the include paths, so forget what I was saying about moving theQT_INSTALL_HEADERS
path into anelse
block; leave that code as it is.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.
Hello,
I'm back, I'll be able to test that this week.
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.
@jacquetc Have you had a chance to test the code I posted above?
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.
No yet, I'll take time tomorrow at noon
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.
Tested, exactly the same error.