summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-07-12 18:04:44 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-07-17 16:58:02 (GMT)
commit7174b5c135f39b448925551c433cb60fc618d7af (patch)
treed443878ceb9fd86753bc0169be9ea2986c0fad89
parent9c04e508898da677fd98fcb2f3291b9152e69320 (diff)
downloadhdf5-7174b5c135f39b448925551c433cb60fc618d7af.zip
hdf5-7174b5c135f39b448925551c433cb60fc618d7af.tar.gz
hdf5-7174b5c135f39b448925551c433cb60fc618d7af.tar.bz2
HDFFV-8631 mingw is different platform
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake13
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--test/CMakeLists.txt4
3 files changed, 11 insertions, 10 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 63d9ee9..35ec3e9 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -61,14 +61,15 @@ endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------
-
set (WINDOWS)
+
+if (MINGW)
+ set (${HDF_PREFIX}_HAVE_MINGW 1)
+ set (WINDOWS 1) # MinGW tries to imitate Windows
+ set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
+endif ()
+
if (WIN32)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_MINGW 1)
- set (WINDOWS 1) # MinGW tries to imitate Windows
- set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
- endif ()
set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
if (NOT UNIX AND NOT MINGW)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6c5b2aa..b6c3351 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -973,7 +973,7 @@ if (NOT EXISTS ${HDF5_GENERATED_SOURCE_DIR}/H5Tinit.c)
target_compile_definitions(H5detect PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
TARGET_C_PROPERTIES (H5detect STATIC)
target_link_libraries (H5detect
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
@@ -1063,7 +1063,7 @@ target_include_directories (H5make_libsettings PRIVATE "${HDF5_SRC_DIR};${HDF5_B
target_compile_definitions(H5make_libsettings PUBLIC ${HDF_EXTRA_C_FLAGS} ${HDF_EXTRA_FLAGS})
TARGET_C_PROPERTIES (H5make_libsettings STATIC)
target_link_libraries (H5make_libsettings
- PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE "$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_LIBRARIES}>" $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
PRIVATE $<$<PLATFORM_ID:Emscripten>:"-O0">
)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 9173531..8333c78 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -35,7 +35,7 @@ if (NOT ONLY_SHARED_LIBS)
TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
target_link_libraries (${HDF5_TEST_LIB_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
- PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
)
if (MINGW)
target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
@@ -56,7 +56,7 @@ if (BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
- PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib>
+ PRIVATE $<$<OR:$<PLATFORM_ID:Windows>,$<PLATFORM_ID:MinGW>>:ws2_32.lib>
)
if (MINGW)
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")