Skip to content
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

Allow to create #cfg for adding specific method in qt6 or qt5 #765

Closed
Montel opened this issue Dec 15, 2023 · 2 comments · Fixed by #907
Closed

Allow to create #cfg for adding specific method in qt6 or qt5 #765

Montel opened this issue Dec 15, 2023 · 2 comments · Fixed by #907
Labels
⬆️ feature New feature or request 🥳🎉 1.0 This issue is part of stabilization for 1.0 release

Comments

@Montel
Copy link
Contributor

Montel commented Dec 15, 2023

Hi,
Qt5 and Qt6 must have new methods or method removed.
We must be able to use a #cfg(...) for adding it in specific qt_version_major

Idea is using specific mod

For example:
#[cfg(qt_version_major = "6")]
#[cxx::bridge]
mod ffi_qt_6 {
...
}

At the moment it doesn't build ad it seems that qt_version_major is not forwarded by the build system.

We really need to add it if we want to support new qt6 methods.

@ahayzen-kdab ahayzen-kdab added ⬆️ feature New feature or request 🥳🎉 1.0 This issue is part of stabilization for 1.0 release labels Dec 15, 2023
@ahayzen-kdab
Copy link
Collaborator

Note that once we have #840 we might be able to do something in our own macro to include / exclude methods via a macro / feature / version detection etc.

@ahayzen-kdab
Copy link
Collaborator

So CXX supports cfg attributes, but in cxx_gen the cfg_evaluator is private https://github.com/dtolnay/cxx/blob/1fd8a5fcaa7ea97532c58f4c9320989d63451f6b/gen/src/mod.rs#L61 So we need a way to reach this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⬆️ feature New feature or request 🥳🎉 1.0 This issue is part of stabilization for 1.0 release
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants