mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Link the C++ lib against the interpreter
This commit is contained in:
parent
372ba09741
commit
dbf06f73cc
4 changed files with 8 additions and 2 deletions
|
@ -13,7 +13,12 @@ publish = false
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
crate-type = ["cdylib"]
|
crate-type = ["cdylib"]
|
||||||
|
|
||||||
|
[features]
|
||||||
|
# In the future, this shouldn't be a default feature, but should be enabled by cmake
|
||||||
|
default = ["sixtyfps-interpreter"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sixtyfps-corelib = { version = "=0.0.5", path="../../sixtyfps_runtime/corelib", features = ["ffi"] }
|
sixtyfps-corelib = { version = "=0.0.5", path="../../sixtyfps_runtime/corelib", features = ["ffi"] }
|
||||||
sixtyfps-rendering-backend-default = { version = "=0.0.5", path="../../sixtyfps_runtime/rendering_backends/default" }
|
sixtyfps-rendering-backend-default = { version = "=0.0.5", path="../../sixtyfps_runtime/rendering_backends/default" }
|
||||||
|
sixtyfps-interpreter = { version = "=0.0.5", path="../../sixtyfps_runtime/interpreter", features = ["ffi"], optional = true }
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ path = "lib.rs"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
display-diagnostics = ["sixtyfps-compilerlib/display-diagnostics"]
|
display-diagnostics = ["sixtyfps-compilerlib/display-diagnostics"]
|
||||||
|
ffi = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
sixtyfps-corelib = { version = "=0.0.5", path = "../corelib", features = ["rtti"] }
|
sixtyfps-corelib = { version = "=0.0.5", path = "../corelib", features = ["rtti"] }
|
||||||
|
|
|
@ -738,6 +738,7 @@ pub mod testing {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// For the C++ integration
|
||||||
#[cfg(feature = "ffi")]
|
#[cfg(feature = "ffi")]
|
||||||
pub mod ffi {
|
pub mod ffi {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
|
@ -320,8 +320,7 @@ fn gen_backend(root_dir: &Path, include_dir: &Path) -> anyhow::Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_interpreter(root_dir: &Path, include_dir: &Path) -> anyhow::Result<()> {
|
fn gen_interpreter(root_dir: &Path, include_dir: &Path) -> anyhow::Result<()> {
|
||||||
let mut config = default_config();
|
let config = default_config();
|
||||||
config.export.include.push("ValueOpaque".into());
|
|
||||||
let mut crate_dir = root_dir.to_owned();
|
let mut crate_dir = root_dir.to_owned();
|
||||||
crate_dir.extend(["sixtyfps_runtime", "interpreter"].iter());
|
crate_dir.extend(["sixtyfps_runtime", "interpreter"].iter());
|
||||||
cbindgen::Builder::new()
|
cbindgen::Builder::new()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue