Skip to content

Commit 747befc

Browse files
committed
Starting rust wrapper
1 parent 3c0ebf8 commit 747befc

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ topylogic/__pycache__/*
3434
topylogic/topylogic.py
3535
topylogic/_topylogic.so
3636
topylogic/topylogic_wrap.c
37+
38+
#rustopologic/RustWrap/Cargo.toml
39+
rustopologic/RustWrap/Cargo.lock
40+
rustopologic/RustWrap/target/*

rustopologic/RustWrap/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "RustWrap"
3+
version = "0.1.0"
4+
authors = ["BTMichalowicz <benjaminmichalowicz98@gmail.com>"]
5+
edition = "2018"
6+
7+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
9+
[dependencies]
10+
libc = "0.2.0"
11+

rustopologic/RustWrap/src/build.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
fn main(){
2+
pkg_config::Config::new()
3+
.atleast_version("1.0")
4+
.probe("z")
5+
.unwrap();
6+
7+
let src=[
8+
"../../../src/*.c"
9+
];
10+
let include=[
11+
"../../../include/*.h"
12+
];
13+
let mut builder = cc::Build::new();
14+
let build = builder
15+
.files(src.iter())
16+
.include("../../../include/*")
17+
.flag("-Wall")
18+
.flag("-Werror")
19+
.flag("-g")
20+
.flag("-lpthread")
21+
.flag("-pthread")
22+
.flag("-L. -ltopologic -lfl -fPIC")
23+
.define("USE_ZLIB", None);
24+
25+
build.compile("rustopologic");
26+
}

rustopologic/RustWrap/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

0 commit comments

Comments
 (0)