Fix linking of the interpreter

I don't know why, byt the 'crate-type = "lib"' seem to fix the problem
This commit is contained in:
Olivier Goffart 2021-03-17 12:38:05 +01:00
parent 9e66ec71ce
commit 6e9d4f9e8d
4 changed files with 5 additions and 12 deletions

View file

@ -11,7 +11,7 @@ publish = false
[lib] [lib]
path = "lib.rs" path = "lib.rs"
crate-type = ["cdylib"] crate-type = ["lib", "cdylib"]
[features] [features]
# In the future, this shouldn't be a default feature, but should be enabled by cmake # In the future, this shouldn't be a default feature, but should be enabled by cmake

View file

@ -11,7 +11,7 @@ LICENSE END */
#[doc(hidden)] #[doc(hidden)]
#[cold] #[cold]
pub extern "C" fn use_modules() -> usize { pub fn use_modules() -> usize {
#[cfg(feature = "sixtyfps-interpreter")] #[cfg(feature = "sixtyfps-interpreter")]
sixtyfps_interpreter::use_modules(); sixtyfps_interpreter::use_modules();
sixtyfps_rendering_backend_default::use_modules(); sixtyfps_rendering_backend_default::use_modules();

View file

@ -740,7 +740,7 @@ pub mod testing {
#[cfg(feature = "ffi")] #[cfg(feature = "ffi")]
#[allow(missing_docs)] #[allow(missing_docs)]
pub mod ffi { pub(crate) mod ffi {
use super::*; use super::*;
#[repr(C)] #[repr(C)]

View file

@ -107,14 +107,7 @@ pub use sixtyfps_corelib::{Brush, Color, SharedString, SharedVector};
/// This only use functions from modules which are not otherwise used. /// This only use functions from modules which are not otherwise used.
#[doc(hidden)] #[doc(hidden)]
#[cold] #[cold]
#[cfg(not(target_arch = "wasm32"))]
pub fn use_modules() -> usize {
#[cfg(feature = "ffi")] #[cfg(feature = "ffi")]
{ pub fn use_modules() -> usize {
crate::api::ffi::sixtyfps_interpreter_value_new as usize crate::api::ffi::sixtyfps_interpreter_value_new as usize
} }
#[cfg(not(feature = "ffi"))]
{
0
}
}