Add CMake example

This commit is contained in:
Jörn-Michael Miehe
2019-08-15 16:52:52 +02:00
parent 12f8d239f8
commit 1f8a5265f6
5 changed files with 43 additions and 0 deletions

11
rust-to-cmake/src/main.rs Normal file
View File

@@ -0,0 +1,11 @@
extern crate libc;
extern {
fn double_input(input: libc::c_int) -> libc::c_int;
}
fn main() {
let input = 4;
let output = unsafe { double_input(input) };
println!("{} * 2 = {}", input, output);
}