Skip to content

Commit

Permalink
Merge pull request #2914 from MehdiChinoune/mingw-plugins
Browse files Browse the repository at this point in the history
CMake: Enable plugins on MinGW
  • Loading branch information
WardF authored May 6, 2024
2 parents 7c96430 + 8d6ba9f commit f5c9183
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
12 changes: 4 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion libncpoco/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f5c9183

Please sign in to comment.