diff --git a/pq-src/Cargo.toml b/pq-src/Cargo.toml index 6326c12..acdae5c 100644 --- a/pq-src/Cargo.toml +++ b/pq-src/Cargo.toml @@ -17,6 +17,7 @@ include = [ description = "Bundled version of libpq" license = "MIT OR Apache-2.0" repository = "https://github.com/sgrif/pq-sys" +links = "pq_sys_src" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/pq-src/build.rs b/pq-src/build.rs index ebfb879..d402d2e 100644 --- a/pq-src/build.rs +++ b/pq-src/build.rs @@ -220,15 +220,15 @@ fn main() { basic_build .clone() - .files(LIBPORTS.iter().map(|p| format!("{path}{port_path}{p}"))) - .compile("ports"); - - basic_build - .clone() - .files(LIBCOMMON.iter().map(|p| format!("{path}{common_path}{p}"))) - .compile("pgcommon"); - - basic_build - .files(LIBPQ.iter().map(|p| format!("{path}{pq_path}{p}"))) + .files( + LIBPORTS + .iter() + .map(|p| format!("{path}{port_path}{p}")) + .chain(LIBCOMMON.iter().map(|p| format!("{path}{common_path}{p}"))) + .chain(LIBPQ.iter().map(|p| format!("{path}{pq_path}{p}"))), + ) .compile("pq"); + + println!("cargo:include={path}/src/include"); + println!("cargo:lib_dir={}", std::env::var("OUT_DIR").expect("Set by cargo")); }