diff --git a/pq-src/build.rs b/pq-src/build.rs index a2a1556..2044043 100644 --- a/pq-src/build.rs +++ b/pq-src/build.rs @@ -2,7 +2,6 @@ use std::path::PathBuf; use std::{env, fs}; const LIBPORTS_BASE: &[&str] = &[ - "strlcat.c", "strlcpy.c", "snprintf.c", "pg_crc32c_sb8.c", @@ -48,6 +47,7 @@ const LIBPORTS_WINDOWS: &[&str] = &[ "win32stat.c", "open.c", "dirmod.c", + "strlcat.c", ]; const LIBCOMMON_BASE: &[&str] = &[ @@ -232,6 +232,8 @@ fn main() { let out = env::var("OUT_DIR").expect("Set by cargo"); let include_path = PathBuf::from(&out).join("include"); let lib_pq_path = PathBuf::from(format!("{path}/{pq_path}")); + let postgres_include_path = PathBuf::from(format!("{path}src/include")); + let additional_includes_path = PathBuf::from(format!("{crate_dir}/additional_include")); fs::create_dir_all(&include_path).expect("Failed to create include directory"); fs::create_dir_all(include_path.join("postgres").join("internal")) .expect("Failed to create include directory"); @@ -245,6 +247,16 @@ fn main() { include_path.join("libpq-events.h"), ) .expect("Copying headers failed"); + fs::copy( + postgres_include_path.join("postgres_ext.h"), + include_path.join("postgres_ext.h"), + ) + .expect("Copying headers failed"); + fs::copy( + additional_includes_path.join("pg_config_ext.h"), + include_path.join("pg_config_ext.h"), + ) + .expect("Copying headers failed"); fs::copy( lib_pq_path.join("libpq-int.h"),