Skip to content

Commit

Permalink
Fix dllexport for mingw-dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Jul 9, 2021
1 parent f7d4a6d commit 2c67800
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions ports/gdal/0006-Fix-mingw-dllexport.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/port/cpl_port.h b/port/cpl_port.h
index 9e3ebbb..130af04 100644
--- a/port/cpl_port.h
+++ b/port/cpl_port.h
@@ -343,7 +343,7 @@ typedef unsigned int GUIntptr_t;
#endif

#ifndef CPL_DLL
-#if defined(_MSC_VER) && !defined(CPL_DISABLE_DLL)
+#if defined(WIN32) && !defined(CPL_DISABLE_DLL)
# ifdef GDAL_COMPILATION
# define CPL_DLL __declspec(dllexport)
# else
4 changes: 3 additions & 1 deletion ports/gdal/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ set(GDAL_PATCHES
0004-Fix-cfitsio.patch
0005-Fix-configure.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
list(APPEND GDAL_PATCHES 0003-Fix-static-build.patch)
else()
list(APPEND GDAL_PATCHES 0006-Fix-mingw-dllexport.patch)
endif()

vcpkg_extract_source_archive_ex(
Expand Down

0 comments on commit 2c67800

Please sign in to comment.