mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2024-12-26 18:14:51 +00:00
Fix C files not being packaged on Rust crates
This commit is contained in:
parent
59f143b21d
commit
6102f2cf7d
4
.github/workflows/publish_crate.yml
vendored
4
.github/workflows/publish_crate.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
|
||||
- name: Upload crate
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
||||
run: cd rust && cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build Rust bindings
|
||||
run: cd rust && cargo build --release
|
||||
run: cargo build --release
|
||||
|
15
.gitignore
vendored
15
.gitignore
vendored
@ -213,3 +213,18 @@ cython_debug/
|
||||
|
||||
.vscode/
|
||||
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
Cargo.lock
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
||||
|
||||
# Added by cargo
|
||||
|
||||
/target
|
||||
|
@ -8,15 +8,19 @@ version = "1.5.4"
|
||||
edition = "2021"
|
||||
authors = ["Anghelo Carvajal <angheloalf95@gmail.com>"]
|
||||
description = "MIPS instruction decoder"
|
||||
readme = "../README.md"
|
||||
readme = "README.md"
|
||||
homepage = "https://github.com/Decompollaborate/rabbitizer"
|
||||
repository = "https://github.com/Decompollaborate/rabbitizer"
|
||||
license = "MIT"
|
||||
keywords = ["MIPS", "decoder"]
|
||||
build = "build.rs"
|
||||
build = "rust/build.rs"
|
||||
include = ["/rust/src", "/rust/build.rs", "/src", "/include"]
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[lib]
|
||||
path = "rust/src/lib.rs"
|
||||
|
||||
[dependencies]
|
||||
cty = "0.2.2"
|
||||
libc = "0.2.138"
|
15
rust/.gitignore
vendored
15
rust/.gitignore
vendored
@ -1,15 +0,0 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
|
||||
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||
Cargo.lock
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
||||
|
||||
# Added by cargo
|
||||
|
||||
/target
|
@ -1,13 +1,6 @@
|
||||
fn main() {
|
||||
let mut c_paths: Vec<std::path::PathBuf> = glob::glob("../src/**/*.c").unwrap().filter_map(|g| g.ok()).collect();
|
||||
let mut h_paths: Vec<std::path::PathBuf> = glob::glob("../include/**/*.h").unwrap().filter_map(|g| g.ok()).collect();
|
||||
|
||||
// Needed because `cargo publish` is dumb
|
||||
let mut c_paths_2: Vec<std::path::PathBuf> = glob::glob("../../../../src/**/*.c").unwrap().filter_map(|g| g.ok()).collect();
|
||||
let mut h_paths_2: Vec<std::path::PathBuf> = glob::glob("../../../../include/**/*.h").unwrap().filter_map(|g| g.ok()).collect();
|
||||
|
||||
c_paths.append(&mut c_paths_2);
|
||||
h_paths.append(&mut h_paths_2);
|
||||
let c_paths: Vec<std::path::PathBuf> = glob::glob("src/**/*.c").unwrap().filter_map(|g| g.ok()).collect();
|
||||
let h_paths: Vec<std::path::PathBuf> = glob::glob("include/**/*.h").unwrap().filter_map(|g| g.ok()).collect();
|
||||
|
||||
for path in c_paths.iter().chain(&h_paths) {
|
||||
println!("cargo:rerun-if-changed={}", path.to_string_lossy());
|
||||
@ -17,8 +10,7 @@ fn main() {
|
||||
|
||||
cc::Build::new()
|
||||
.files(c_paths)
|
||||
.include("../include")
|
||||
.include("../../../../include")
|
||||
.include("include")
|
||||
.warnings(false)
|
||||
.compile("rabbitizer");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user