Skip to content

Commit

Permalink
add HDF5_H5_IS_DLL variable to switch the scenario when HDF5 is built…
Browse files Browse the repository at this point in the history
… as a DLL (#1931)
  • Loading branch information
hobu authored and rouault committed Jan 3, 2020
1 parent 9cf37ca commit 0a3365a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion gdal/frmts/hdf5/makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ OBJ = hdf5dataset.obj hdf5imagedataset.obj \

PLUGIN_DLL = gdal_HDF5.dll

EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32 -D_HDF5USEDLL_
EXTRAFLAGS = -I$(HDF5_DIR)\include -DWIN32

# From the HDF docs...
# Users who want to build and run an application with HDF5 in Visual Studio
# without using CMake should consult the USING_HDF5_VS.txt file. Building
# applications with the dynamic/shared hdf5 libraries requires that the
# "H5_BUILT_AS_DYNAMIC_LIB" compile definition be used.

!IF "$(HDF5_H5_IS_DLL)" == "YES"
EXTRAFLAGS = $(EXTRAFLAGS) -DH5_BUILT_AS_DYNAMIC_LIB
!ELSE
EXTRAFLAGS = $(EXTRAFLAGS) -D_HDF5USEDLL_
!ENDIF

!IF "$(HDF5_PLUGIN)" == "YES"
EXTRAFLAGS = $(EXTRAFLAGS) -DHDF5_PLUGIN
Expand Down
4 changes: 4 additions & 0 deletions gdal/nmake.opt
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,10 @@ KAKADU_7_5_OR_LATER = YES
#HDF5_DIR = c:\warmerda\supportlibs\hdf5\5-164-win
#HDF5_LIB = $(HDF5_DIR)\dll\hdf5dll.lib

# Needed to define H5_BUILT_AS_DYNAMIC_LIB for windows compilation
# scenarios where it is not exported on the target (non-CMake builds)
#HDF5_H5_IS_DLL = YES

# Uncomment the following and update to enable KEA support.
#KEA_PLUGIN = NO
#KEA_CFLAGS = -Ic:\kea\include
Expand Down

0 comments on commit 0a3365a

Please sign in to comment.