This is an automated email from the ASF dual-hosted git repository.
jiayu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/sedona-db.git
The following commit(s) were added to refs/heads/main by this push:
new 55af9a1 fix(r/sedonadb): Fix geos build error on Windows (#78)
55af9a1 is described below
commit 55af9a11c35188a3f85b099aa998dba75dc1080f
Author: Hiroaki Yutani <[email protected]>
AuthorDate: Wed Sep 17 09:28:17 2025 +0900
fix(r/sedonadb): Fix geos build error on Windows (#78)
---
r/sedonadb/src/Makevars.win.in | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/r/sedonadb/src/Makevars.win.in b/r/sedonadb/src/Makevars.win.in
index a9f15a4..3144a58 100644
--- a/r/sedonadb/src/Makevars.win.in
+++ b/r/sedonadb/src/Makevars.win.in
@@ -15,6 +15,15 @@ PKG_LIBS = -L$(LIBDIR) -lsedonadb -lws2_32 -ladvapi32
-luserenv -lbcrypt -lntdll
# to overwrite it via configuration.
CARGO_LINKER = x86_64-w64-mingw32.static.posix-gcc.exe
+# It seems pkg-config requires this envvar to be explicitly set in case of
cross-compilation.
+#
+# cf. https://stackoverflow.com/a/68979087
+PKG_CONFIG_SYSROOT_DIR = /x86_64-w64-mingw32.static.posix/
+
+# TODO: should $(CFLAGS) be included here?
+# Do not pass -pedantic
+CFLAGS_TWEAKED = $(subst -pedantic,,$(ALL_CPPFLAGS))
+
all: $(SHLIB) clean_intermediate
$(SHLIB): $(STATLIB)
@@ -27,8 +36,9 @@ $(STATLIB):
export CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER="$(CARGO_LINKER)" && \
export LIBRARY_PATH="$${LIBRARY_PATH};$(LIBDIR)/libgcc_mock" && \
+ export PKG_CONFIG_SYSROOT_DIR="$(PKG_CONFIG_SYSROOT_DIR)" && \
export CC="$(CC)" && \
- export CFLAGS="$(CFLAGS)" && \
+ export CFLAGS="$(CFLAGS_TWEAKED)" && \
export RUSTFLAGS="$(RUSTFLAGS)" && \
cargo build --target $(TARGET) --lib --profile $(PROFILE)
$(FEATURE_FLAGS) --manifest-path ./rust/Cargo.toml --target-dir $(TARGET_DIR)