mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
C++ Only link against the backend library
For some raison, not all symbols gets exported, add some dummy code which seems to do the trick
This commit is contained in:
parent
8f0520f2be
commit
54f81d4d29
5 changed files with 24 additions and 7 deletions
|
@ -7,8 +7,6 @@ build = "build.rs"
|
|||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
crate-type = [ "lib", "cdylib" ]
|
||||
|
||||
|
||||
[features]
|
||||
# Allow the vewer to query at runtime information about item types
|
||||
|
|
|
@ -134,3 +134,14 @@ pub unsafe extern "C" fn sixtyfps_signal_set_handler(
|
|||
pub unsafe extern "C" fn sixtyfps_signal_drop(handle: *mut SignalOpaque) {
|
||||
core::ptr::read(handle as *mut Signal<()>);
|
||||
}
|
||||
|
||||
/// Somehow this is required for the extern "C" things to be exported in a dependent dynlib
|
||||
#[doc(hidden)]
|
||||
pub fn dummy() {
|
||||
#[derive(Clone)]
|
||||
struct Foo;
|
||||
foo(Foo);
|
||||
fn foo(f: impl Clone) {
|
||||
let _ = f.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,3 +156,13 @@ pub extern "C" fn solve_grid_layout(data: &GridLayoutData) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Somehow this is required for the extern "C" things to be exported in a dependent dynlib
|
||||
pub fn dummy() {
|
||||
#[derive(Clone)]
|
||||
struct Foo;
|
||||
foo(Foo);
|
||||
fn foo(f: impl Clone) {
|
||||
let _ = f.clone();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ impl CMakeCommand {
|
|||
|
||||
let mut target_dir = None;
|
||||
|
||||
let mut params = vec!["-p", "sixtyfps_corelib", "-p", "sixtyfps_rendering_backend_gl"];
|
||||
let mut params = vec!["-p", "sixtyfps_rendering_backend_gl"];
|
||||
params.extend(build_params);
|
||||
|
||||
let mut first_lib: PathBuf = PathBuf::new();
|
||||
|
@ -59,9 +59,7 @@ impl CMakeCommand {
|
|||
run_cargo(&cargo(), "build", ¶ms, |message| {
|
||||
match message {
|
||||
Message::CompilerArtifact(ref artifact) => {
|
||||
if artifact.target.name != "sixtyfps_rendering_backend_gl"
|
||||
&& artifact.target.name != "sixtyfps_corelib"
|
||||
{
|
||||
if artifact.target.name != "sixtyfps_rendering_backend_gl" {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue