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]
|
[dependencies]
|
||||||
lazy_static = "0.2.8"
|
lazy_static = "0.2.8"
|
||||||
libc = "0.2.26"
|
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
|
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
|
lib.o: lib.cpp
|
||||||
ar rcs $@ $<
|
|
||||||
|
|
||||||
clean:
|
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() {
|
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 PCache = *mut c_void;
|
||||||
pub type PPkgIterator = *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 = "apt-pkg")]
|
||||||
#[link(name = "stdc++")]
|
#[link(name = "stdc++")]
|
||||||
extern {
|
extern {
|
||||||
|
Loading…
Reference in New Issue
Block a user