Update Android build scripts. Remove unnecessary project files
This commit is contained in:
5
examples/rust/binding-example/Cargo.lock
generated
Normal file
5
examples/rust/binding-example/Cargo.lock
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "binding-example"
|
||||
version = "0.1.0"
|
||||
10
examples/rust/binding-example/Cargo.toml
Normal file
10
examples/rust/binding-example/Cargo.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "binding-example"
|
||||
version = "0.1.0"
|
||||
authors = ["Joseph Henry <joseph.henry@zerotier.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
#rustc-link-search = ["../../../lib/debug/macos-x86_64/"]
|
||||
|
||||
[dependencies]
|
||||
4
examples/rust/binding-example/build.rs
Normal file
4
examples/rust/binding-example/build.rs
Normal file
@@ -0,0 +1,4 @@
|
||||
fn main() {
|
||||
println!("cargo:rustc-flags=-l dylib=c++");
|
||||
//println!("cargo:rustc-link-search=.");
|
||||
}
|
||||
10
examples/rust/binding-example/src/main.rs
Normal file
10
examples/rust/binding-example/src/main.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
#[link(name = "libzt", kind = "dylib")]
|
||||
extern {
|
||||
fn zts_socket(address_family: i32) -> i32;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = unsafe { zts_socket(100) };
|
||||
println!("zts_socket() = {}", x);
|
||||
}
|
||||
Reference in New Issue
Block a user