diff --git a/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/fix-makefile-mod.patch b/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/fix-makefile-mod.patch new file mode 100644 index 00000000..bc6fbb27 --- /dev/null +++ b/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/fix-makefile-mod.patch @@ -0,0 +1,43 @@ +diff --git a/makefile_mod.vc b/makefile_mod.vc +index 4815377..dbdbede 100644 +--- a/makefile_mod.vc ++++ b/makefile_mod.vc +@@ -93,7 +93,7 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \ + MOD_SPATIALITE_DLL = mod_spatialite$(VERSION).dll + + CFLAGS = /nologo -I.\src\headers -I.\src\topology \ +- -I. -IC:\OSGeo4W\include $(OPTFLAGS) ++ -I. $(OPTFLAGS) + + default: all + +@@ -107,12 +107,9 @@ mod_spatialite.lib: $(LIBOBJ) + $(MOD_SPATIALITE_DLL): mod_spatialite_i.lib + + mod_spatialite_i.lib: $(LIBOBJ) +- link /dll /out:$(MOD_SPATIALITE_DLL) \ ++ link $(LINK_FLAGS) /dll /out:$(MOD_SPATIALITE_DLL) \ + /implib:mod_spatialite_i.lib $(LIBOBJ) \ +- C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \ +- C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \ +- C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \ +- C:\OSGeo4W\lib\libxml2.lib C:\OSGeo4W\lib\librttopo.lib ++ $(LIBS_ALL) + if exist $(MOD_SPATIALITE_DLL).manifest mt -manifest \ + $(MOD_SPATIALITE_DLL).manifest -outputresource:$(MOD_SPATIALITE_DLL);2 + +diff --git a/nmake_mod.opt b/nmake_mod.opt +index 7772853..df6ec25 100644 +--- a/nmake_mod.opt ++++ b/nmake_mod.opt +@@ -1,8 +1,8 @@ + # Directory tree where SpatiaLite will be installed. +-INSTDIR=C:\OSGeo4W ++INSTDIR=$(INST_DIR) + + # Uncomment the first for an optimized build, or the second for debug. +-OPTFLAGS= /nologo /Ox /fp:precise /W4 /MD /D_CRT_SECURE_NO_WARNINGS \ ++OPTFLAGS= /nologo /fp:precise /W4 $(CL_FLAGS) /D_CRT_SECURE_NO_WARNINGS \ + /DDLL_EXPORT /DLOADABLE_EXTENSION /DYY_NO_UNISTD_H + #OPTFLAGS= /nologo /Zi /MD /Fdmod_spatialite.pdb /DDLL_EXPORT + diff --git a/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/ok-load-permanently.patch b/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/ok-load-permanently.patch new file mode 100644 index 00000000..81c33b7e --- /dev/null +++ b/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/ok-load-permanently.patch @@ -0,0 +1,13 @@ +diff --git a/src/spatialite/spatialite.c b/src/spatialite/spatialite.c +index 9d6063d..f3dda37 100644 +--- a/src/spatialite/spatialite.c ++++ b/src/spatialite/spatialite.c +@@ -53439,7 +53439,7 @@ init_spatialite_extension (sqlite3 * db, char **pzErrMsg, + /* setting a timeout handler */ + sqlite3_busy_timeout (db, 5000); + +- return 0; ++ return SQLITE_OK_LOAD_PERMANENTLY; + } + #endif + diff --git a/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/portfile.cmake b/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/portfile.cmake index 05dbe871..6f7aea20 100644 --- a/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/portfile.cmake +++ b/vcpkg-vendor/vcpkg-overlay-ports/libspatialite/portfile.cmake @@ -9,10 +9,12 @@ vcpkg_extract_source_archive( ARCHIVE "${ARCHIVE}" PATCHES fix-makefiles.patch + fix-makefile-mod.patch fix-linux-configure.patch gaiaconfig-msvc.patch fix-mingw.patch fix-utf8-source.patch + ok-load-permanently.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS unused @@ -95,6 +97,22 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) "LINK_FLAGS=/debug" ) + vcpkg_install_nmake( + SOURCE_PATH "${SOURCE_PATH}" + PROJECT_NAME makefile_mod.vc + PREFER_JOM + CL_LANGUAGE C + OPTIONS_RELEASE + "CL_FLAGS=${CL_FLAGS_RELEASE}" + "INST_DIR=${INST_DIR}" + "LIBS_ALL=${LIBS_ALL_RELEASE}" + OPTIONS_DEBUG + "CL_FLAGS=${CL_FLAGS_DEBUG}" + "INST_DIR=${INST_DIR}\\debug" + "LIBS_ALL=${LIBS_ALL_DEBUG}" + "LINK_FLAGS=/debug" + ) + vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")