Skip to content

Commit 7f31f3f

Browse files
committed
Patch GDAL to fix windows_arm64 builds
GDAL dependency was adding `/machine:x64` linker flag for all 64-bit platforms. On ARM64 this causes linking errors like this: > fatal error LNK1112: module machine type 'ARM64' conflicts with target machine type 'x64' The added patch checks for `ARM64` and `AMD64` arches before setting correct linker arg. Ref: duckdblabs/duckdb-internal#5891
1 parent 91a6649 commit 7f31f3f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- a/gdal.cmake
2+
+++ b/gdal.cmake
3+
@@ -619,8 +619,10 @@
4+
if (MSVC)
5+
target_sources(${GDAL_LIB_TARGET_NAME} PRIVATE gcore/Version.rc)
6+
source_group("Resource Files" FILES gcore/Version.rc)
7+
- if (CMAKE_CL_64)
8+
+ if (CMAKE_SYSTEM_PROCESSOR STREQUAL AMD64)
9+
set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
10+
+ elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL ARM64)
11+
+ set_target_properties(${GDAL_LIB_TARGET_NAME} PROPERTIES STATIC_LIBRARY_FLAGS "/machine:arm64")
12+
endif ()
13+
endif ()
14+

vcpkg_ports/gdal/portfile.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ vcpkg_from_github(
1212
duckdb_gdal_json.patch
1313
duckdb_gdal_msys.patch
1414
duckdb_gdal_remove_filehandler.patch
15+
duckdb_gdal_windows_static.patch
1516
)
1617
# `vcpkg clean` stumbles over one subdir
1718
file(REMOVE_RECURSE "${SOURCE_PATH}/autotest")

0 commit comments

Comments
 (0)