Build changes to make communicator build on macos.

This commit is contained in:
Elizabeth Murray
2025-06-17 08:39:47 -07:00
parent 782062014e
commit 09791177a2
4 changed files with 14 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ OBJS = \
PG_CPPFLAGS = -I$(libpq_srcdir)
SHLIB_LINK_INTERNAL = $(libpq)
SHLIB_LINK = -lcurl
SHLIB_LINK += -framework Security -framework CoreFoundation -framework CoreServices -framework IOKit -framework SystemConfiguration
EXTENSION = neon
DATA = \

View File

@@ -37,3 +37,10 @@ utils.workspace = true
[build-dependencies]
cbindgen.workspace = true
[target.'cfg(target_os = "macos")']
rustflags = [
"-l", "framework=Security",
"-l", "framework=CoreFoundation",
"-l", "framework=CoreServices",
]

View File

@@ -2,6 +2,10 @@ use std::env;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
println!("cargo:rustc-link-lib=framework=Security");
println!("cargo:rustc-link-lib=framework=CoreFoundation");
println!("cargo:rustc-link-lib=framework=CoreServices");
println!("cargo:rustc-link-lib=framework=IOKit");
cbindgen::generate(crate_dir).map_or_else(
|error| match error {

View File

@@ -342,7 +342,7 @@ callback_set_my_latch_unsafe(void)
* FIXME: The logic from neon_get_request_lsns() needs to go here, except for
* the last-written LSN cache stuff, which is managed by the rust code now.
*/
uint64
uint64_t
callback_get_request_lsn_unsafe(void)
{
/*
@@ -659,7 +659,7 @@ retry:
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not read block %lu in local cache file: %m",
cached_block)));
(unsigned long)cached_block)));
bytes_total += nbytes;
}
}