switch to gcc build script
This commit is contained in:
parent
0126dd5220
commit
eaf79f46ed
@ -6,3 +6,6 @@ authors = ["Chris West (Faux) <git@goeswhere.com>"]
|
||||
[dependencies]
|
||||
lazy_static = "0.2.8"
|
||||
libc = "0.2.26"
|
||||
|
||||
[build-dependencies]
|
||||
gcc = "0.3.51"
|
||||
|
1
apt-pkg-c/.gitignore
vendored
Normal file
1
apt-pkg-c/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
lib.o
|
@ -1,11 +1,10 @@
|
||||
CXXFLAGS=-Wall -Wextra -g
|
||||
|
||||
all: libapt-pkg-c.a
|
||||
all: clean check
|
||||
|
||||
lib.o: lib.cpp lib.h
|
||||
check: lib.o
|
||||
|
||||
libapt-pkg-c.a: lib.o
|
||||
ar rcs $@ $<
|
||||
lib.o: lib.cpp
|
||||
|
||||
clean:
|
||||
$(RM) libapt-pkg-c.a lib.o
|
||||
$(RM) lib.o
|
||||
|
4
build.rs
4
build.rs
@ -1,3 +1,5 @@
|
||||
extern crate gcc;
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rustc-link-search=apt-pkg-c")
|
||||
gcc::compile_library("libapt-pkg-c.a", &["apt-pkg-c/lib.cpp"]);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ use libc::c_char;
|
||||
pub type PCache = *mut c_void;
|
||||
pub type PPkgIterator = *mut c_void;
|
||||
|
||||
#[link(name = "apt-pkg-c")]
|
||||
#[link(name = "apt-pkg-c", kind = "static")]
|
||||
#[link(name = "apt-pkg")]
|
||||
#[link(name = "stdc++")]
|
||||
extern {
|
||||
|
Loading…
Reference in New Issue
Block a user