start resolving linker issues

master
Avril 4 years ago
parent fc4c96270e
commit 9023d6d357
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -13,3 +13,6 @@ libc = "0.2.76"
[build-dependencies]
rustc_version = "0.2"
[lib]
crate-type = ["staticlib", "cdylib"]

@ -21,4 +21,9 @@ fn main() {
println!("cargo:rustc-cfg=dev");
}
}
// Link to GHOST and required stuffs
println!(r"cargo:rustc-link-search=./lib");
println!("cargo:rustc-link-lib=dylib=stdc++"); // libstdc++
}

@ -11,6 +11,7 @@ use std::{
ptr::NonNull,
};
#[link(name="bf_intern_ghost")]
extern "C" {
pub fn GHOST_CreateSystem() -> GHOST_SystemHandle;
pub fn GHOST_SystemInitDebug(_: GHOST_SystemHandle, _: c_int);

@ -79,7 +79,10 @@ mod tests {
use super::*;
#[test]
fn it_works() {
// nothing yet.
unsafe {
let ptr = api::GHOST_CreateSystem();
assert!(!ptr.is_null());
}
}
macro_rules! static_assert {
@ -100,6 +103,6 @@ mod tests {
static_assert!(std::mem::size_of::<types::GHOST_GLFlags>() == std::mem::size_of::<DummyCEnum>(),
"C enum is not of type `int`. Either that or #[repr(transparent)] is broken. Aborting.");
static_assert!(std::mem::align_of::<types::GHOST_GLFlags>() == std::mem::align_of::<DummyCEnum>(),
"C enum has unexpected alignment differing from type `int`. Either that or #[repr(transparent)] is broken. Aborting.");
"C enum has unexpected alignment differing from type `int`. Either that or #[repr(transparent)] is broken. Aborting.");
// ..are there others?
}

Loading…
Cancel
Save