-
Notifications
You must be signed in to change notification settings - Fork 82
qt-build-utils: build system changes to have a QtInstallation #1230
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
base: main
Are you sure you want to change the base?
qt-build-utils: build system changes to have a QtInstallation #1230
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1230 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 73 73
Lines 12634 12634
=========================================
Hits 12634 12634 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5f33455
to
8dcd7d5
Compare
634fb0d
to
1ad252a
Compare
fefe5fc
to
155f7a1
Compare
155f7a1
to
86a7f22
Compare
/// TODO: should we hand in a cc::Build or should we instead return a struct | ||
/// with details of the rustc-link-lib / search paths ? and then have the | ||
/// calling function apply those and any flags to the cc::Build? | ||
fn link_modules(&self, builder: &mut cc::Build, qt_modules: &[String]); |
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.
what do we think is the best interface here? Do we pass in a cc::Build
and a list of Qt modules and the QtInstallation
sets up the builder? Or should we just ask the QtInstallation
with a list of Qt modules and it responds with a struct listing all the possible rustc-link options and any flags etc for cc::Build
?
86a7f22
to
cdaf205
Compare
This is just to test what we can do still with the old API
328cc00
to
01dc659
Compare
format!( | ||
"{}/{}Qt{}{}.prl", | ||
lib_path, prefix, version_major, qt_module | ||
) | ||
} | ||
|
||
/// Tell Cargo to link each Qt module. | ||
pub fn cargo_link_libraries(&self, builder: &mut cc::Build) { |
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.
should probably rename to link_qt_modules
or something
init_call: Some(format!("Q_INIT_RESOURCE({name});")), | ||
init_declaration: Some(format!("#include <{init_header}>")), | ||
} | ||
pub fn qrc(&mut self, input_file: impl AsRef<Path>) -> Initializer { |
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.
need to remove these old usages and push everything through rcc()
} | ||
|
||
/// Run moc on a C++ header file and save the output into [cargo's OUT_DIR](https://doc.rust-lang.org/cargo/reference/environment-variables.html). | ||
/// The return value contains the path to the generated C++ file, which can then be passed to [cc::Build::files](https://docs.rs/cc/latest/cc/struct.Build.html#method.file), | ||
/// as well as the path to the generated metatypes.json file, which can be passed to [register_qml_module](Self::register_qml_module). | ||
/// | ||
pub fn moc(&mut self, input_file: impl AsRef<Path>, arguments: MocArguments) -> MocProducts { |
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.
need to just return QtToolMoc
This is part of one of the steps towards #1125 and rewriting qt-build-utils.