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] [build-dependencies]
rustc_version = "0.2" rustc_version = "0.2"
[lib]
crate-type = ["staticlib", "cdylib"]

@ -21,4 +21,9 @@ fn main() {
println!("cargo:rustc-cfg=dev"); 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, ptr::NonNull,
}; };
#[link(name="bf_intern_ghost")]
extern "C" { extern "C" {
pub fn GHOST_CreateSystem() -> GHOST_SystemHandle; pub fn GHOST_CreateSystem() -> GHOST_SystemHandle;
pub fn GHOST_SystemInitDebug(_: GHOST_SystemHandle, _: c_int); pub fn GHOST_SystemInitDebug(_: GHOST_SystemHandle, _: c_int);

@ -79,7 +79,10 @@ mod tests {
use super::*; use super::*;
#[test] #[test]
fn it_works() { fn it_works() {
// nothing yet. unsafe {
let ptr = api::GHOST_CreateSystem();
assert!(!ptr.is_null());
}
} }
macro_rules! static_assert { macro_rules! static_assert {

Loading…
Cancel
Save