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

Build fails when using only QML files in a module (no rust bridges) #1137

Open
dphaldes opened this issue Nov 30, 2024 · 1 comment
Open
Labels
🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo

Comments

@dphaldes
Copy link
Contributor

When trying to build applications with only QML and no rust bridges, the build fails with

cargo:warning=cc1plus: fatal error: /home/chonky/build/rust/kono/target/debug/build/kono-c626df56a33c2707/out/qt-build-utils/qml_plugin/kono_qmltyperegistration.cpp: No such file or directory
cargo:warning=compilation terminated.

Buildscript:

use cxx_qt_build::{CxxQtBuilder, QmlModule};

fn main() {
    CxxQtBuilder::new()
        .qml_module(QmlModule::<&str, &str> {
            uri: "kono",
            qml_files: &["src/qml/main.qml"],
            ..Default::default()
        })
        .build();
}

While this is not a big issue, QML-only applications are a possibility and a meaningful error message would be appreciated.
I stumbled upon this when trying to incrementally add qt to an existing app and this error confused me a lot.

@ahayzen-kdab ahayzen-kdab added 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo 🪲 bug Something isn't working labels Dec 2, 2024
@ahayzen-kdab
Copy link
Collaborator

Thanks for reporting this! We've had a similar situation before and probably missed a case.

For 0.8 we plan on refactoring the build API #1125, where one of the ideas is that one crate could become one QML module and export to CMake or a library crate etc. So this will become increasingly important to support having parts of the input empty.

@LeonMatthesKDAB LeonMatthesKDAB moved this from Todo to ToDo - 0.8 in Cxx-Qt 1.0 Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working 🔨 build system Issues related to integrating CXX-Qt into CMake/Cargo
Projects
Status: ToDo - 0.8
Development

No branches or pull requests

2 participants