fix rust bindings build on windows (#1584)

Refine rust bindings.
This commit is contained in:
shuffle2
2022-04-16 04:40:04 -07:00
committed by GitHub
parent 9620514b68
commit 2912cd1e29
17 changed files with 268 additions and 320 deletions

44
Cargo.toml Normal file
View File

@@ -0,0 +1,44 @@
[package]
name = "unicorn-engine"
version = "2.0.0-rc6"
authors = ["Ziqiao Kong", "Lukas Seidel"]
documentation = "https://github.com/unicorn-engine/unicorn/wiki"
edition = "2021"
license = "GPL-2.0"
readme = "README.md"
repository = "https://github.com/unicorn-engine/unicorn"
description = "Rust bindings for the Unicorn emulator with utility functions"
build = "bindings/rust/build.rs"
links = "unicorn"
# use `cargo publish --list` to see files to be included
# the resulting list what cargo uses to check for out-of-date files during build
exclude = [
"/docs",
"/bindings/dotnet",
"/bindings/go",
"/bindings/haskell",
"/bindings/java",
"/bindings/pascal",
"/bindings/python",
"/bindings/ruby",
"/bindings/vb6",
"/samples",
"/tests",
]
[lib]
path = "bindings/rust/src/lib.rs"
[dependencies]
bitflags = "1.3"
libc = "0.2"
[build-dependencies]
cc = { optional = true, version = "1.0" }
cmake = { optional = true, version = "0.1" }
pkg-config = { optional = true, version = "0.3" }
[features]
default = ["build_unicorn_cmake"]
build_unicorn_cmake = ["cc", "cmake"]
use_system_unicorn = ["pkg-config"]