summaryrefslogtreecommitdiff
path: root/qml_plugin/build.rs
blob: 18e6fc4c052f572549c03bf01dfb90e53db78137 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::fs;

use cxx_qt_build::{CxxQtBuilder, PluginType, QmlModule};

const NAME: &str = "core";
const INTERFACE_DIR: &str = "src/qml_interface";

fn main() {
    let version_script =
        std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("qml_plugin.version");

    println!(
        "cargo:rustc-cdylib-link-arg=-Wl,--version-script={}",
        version_script.display()
    );

    CxxQtBuilder::new_qml_module(QmlModule::new(NAME).plugin_type(PluginType::Dynamic))
        .qt_module("Qml")
        .files(fs::read_dir(INTERFACE_DIR).unwrap().map(|d| d.unwrap().path()))
        .build();
}