Skip to content

Instantly share code, notes, and snippets.

@damienstanton
Created September 8, 2019 13:50
Show Gist options
  • Save damienstanton/4bcf3a2873015418102eac4c55ad8e12 to your computer and use it in GitHub Desktop.
Save damienstanton/4bcf3a2873015418102eac4c55ad8e12 to your computer and use it in GitHub Desktop.
rust/cffi build
extern crate cc;
use std::path::Path;
fn main() {
let host_target = "x86_64-apple-darwin";
cc::Build::new()
.cpp(true)
.file("src/cpp/hello.cpp")
.include("src/cpp")
.out_dir(Path::new("."))
.target(host_target)
.host(host_target)
.opt_level(0)
.compile("libcrust.a");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment