Skip to content

Commit

Permalink
work around broken flag detections in gdal
Browse files Browse the repository at this point in the history
  • Loading branch information
s-u committed Feb 8, 2025
1 parent f00020b commit f02ff1b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recipes/gdal
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Depends: pkgconfig, xz, libpq, proj, openjpeg, libwebp, libgeotiff, freexl, sqli
Source-URL: https://github.com/OSGeo/gdal/releases/download/v${ver}/gdal-${ver}.tar.gz
Source-SHA256: b1c739256d074be42d67c6c3d33eee94c90a490ebb02fcb7fc21c569a6fc78bd
Build-system: cmake
#Note: their CFLAGS/LIBS detection is broken as usual, requires flags to be manually passed from pkg-config
Configure: -DCMAKE_EXE_LINKER_FLAGS="`pkg-config --static --libs libpq libwebp blosc netcdf` -liconv" -DCMAKE_C_FLAGS="`pkg-config --cflags libpq libwebp blosc netcdf`" -DCMAKE_CXX_FLAGS="`pkg-config --cflags libpq libwebp blosc netcdf`" -DGDAL_ENABLE_HDF5_GLOBAL_LOCK=NO
14 changes: 14 additions & 0 deletions recipes/gdal.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff -ru gdal-3.10.1/frmts/hdf5/CMakeLists.txt gdal-3.10.1-1/frmts/hdf5/CMakeLists.txt
--- gdal-3.10.1/frmts/hdf5/CMakeLists.txt 2025-01-09 03:54:06
+++ gdal-3.10.1-1/frmts/hdf5/CMakeLists.txt 2025-02-08 16:48:03
@@ -94,7 +94,9 @@
target_compile_definitions(gdal_HDF5 PRIVATE -DWIN32)
endif ()
target_include_directories(gdal_HDF5 SYSTEM PRIVATE ${HDF5_INCLUDE_DIRS})
-gdal_target_link_libraries(gdal_HDF5 PRIVATE ${HDF5_C_LIBRARIES})
+if (DEFINED HDF5_C_LIBRARIES)
+ gdal_target_link_libraries(gdal_HDF5 PRIVATE ${HDF5_C_LIBRARIES})
+endif ()

if (HDF5_BUILD_SHARED_LIBS)
target_compile_definitions(gdal_HDF5 PRIVATE -DH5_BUILT_AS_DYNAMIC_LIB)

0 comments on commit f02ff1b

Please sign in to comment.