CMake: Enable plugins on MinGW

This commit is contained in:
مهدي شينون (Mehdi Chinoune) 2024-05-01 11:02:04 +01:00 committed by GitHub
parent 4c14a63f44
commit 8d6ba9ffcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 11 deletions

View File

@ -642,14 +642,10 @@ include(CMakeDependentOption)
cmake_dependent_option(NETCDF_ENABLE_PLUGINS "Enable dynamically loaded plugins (default on)."
ON "BUILD_SHARED_LIBS" OFF)
MESSAGE(STATUS "NETCDF_ENABLE_PLUGINS: ${NETCDF_ENABLE_PLUGINS}")
if(MINGW)
message(STATUS "MINGW Detected, disabling plugins.")
set(NETCDF_ENABLE_PLUGINS OFF CACHE BOOL "Disable plugins" FORCE)
else()
if(NOT WIN32)
if(HAVE_DLFCN_H)
include_directories("dlfcn.h")
endif()
if(NOT WIN32)
if(HAVE_DLFCN_H)
include_directories("dlfcn.h")
endif()
endif()

View File

@ -1,6 +1,6 @@
set(libncpoco_SOURCES ncpoco.c ncpoco.h)
if(MSVC)
if(WIN32)
set(libncpoco_SOURCES ${libncpoco_SOURCES} cp_win32.c)
else()
set(libncpoco_SOURCES ${libncpoco_SOURCES} cp_unix.c)

View File

@ -6,7 +6,7 @@
# See netcdf-c/COPYRIGHT file for more info.
set(CMAKE_BUILD_TYPE "")
if(MSVC)
if(WIN32)
set(PLUGINEXT "dll")
set(PLUGINPRE "__nc")
else()
@ -124,7 +124,7 @@ macro(installplugin PLUG)
endmacro()
install(DIRECTORY DESTINATION ${PLUGIN_INSTALL_DIR})
if(Bzip2_FOUND)
if(Bzip2_FOUND OR Bz2_FOUND)
installplugin(h5bzip2)
endif()
if(Zstd_FOUND)