-
Notifications
You must be signed in to change notification settings - Fork 80
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
cxx-qt-lib: use +whole_archive for std_types so that cargo-only works #593
Conversation
3672533
to
3c931d0
Compare
723df93
to
9e988d7
Compare
75cecee
to
81c0e8e
Compare
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 the wording can be improved a bit, but otherwise looks good 👍
When building a staticlib -bundle means that the native static library is simply not included into the archive and some higher level build system will need to add it later during linking of the final binary. https://doc.rust-lang.org/rustc/command-line-arguments.html#option-l-link-lib Otherwise when we build with CMake the libqt-static-initializers.a is not bundled into the final libqt_minimal.a so is then missing from the final binary. Closes KDAB#597
81c0e8e
to
7df274b
Compare
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.
LGTM
I'm concerned that compiling the same C++ code unconditionally with cxx-qt-build could lead to duplicate symbol errors if a user tries to have multiple crates in one project use cxx-qt. If the C++ code is moved to the cxx-qt or cxx-qt-lib crates and multiple crates in the dependency graph use cxx-qt, IIUC they would all share the same build of the C++ code that would only need to be compiled once. But if multiple crates run cxx-qt-build in their build.rs, then those crates are linked into one staticlib (like Firefox does #148), this might cause duplicate symbol errors. |
Note that i tried to create a multi crate project, but this doesn't work as you run into
I tried to have a project where i had the following crate structure each with their own QObject and cxx-qt-build, and then main using public methods from sub1 and sub2.
|
When building with cargo we need to ensure that the statics aren't optimised out for registering types with Qt 5. Otherwise we cannot use numbers in QML. Also move std_types from -lib into -build, which potentially allows us to have cxx-qt-lib separate in the future. Closes KDAB#592
7df274b
to
482a421
Compare
When building with cargo we need to ensure that the statics aren't optimised out for registering types with Qt 5.
Otherwise we cannot use numbers in QML.
Closes #592