Skip to content

Commit

Permalink
Handle multiple include paths
Browse files Browse the repository at this point in the history
and add additional include path needed for mingw64
Closes pgcentralfoundation#1129
  • Loading branch information
robe2 committed May 2, 2023
1 parent 00d8384 commit 68b39b1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pgrx-pg-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,10 @@ fn pg_target_include_flags(pg_version: u16, pg_config: &PgConfig) -> eyre::Resul
match value {
// No configured value: ask `pg_config`.
None => {
#[cfg( not(target_family = "windows") )]
let include_dir = pg_config.includedir_server()?.display().to_string();
#[cfg(target_family = "windows")]
let include_dir = format!("{0} {0}/port/win32", pg_config.includedir_server()?.display().to_string());
let include_dirs: Vec<&str> = include_dir.split_whitespace().collect();
let include_args: Vec<String> = include_dirs.into_iter().map(|dir| format!("-I{}", dir)).collect();
out = include_args;
Expand Down

0 comments on commit 68b39b1

Please sign in to comment.