[soci] Update to v4.1.4 (#52501)

This commit is contained in:
Robert Adam 2026-07-02 04:17:22 +02:00 committed by GitHub
parent 3b0889cf23
commit 0b8e35c385
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 44 additions and 177 deletions

View File

@ -1,100 +0,0 @@
diff --git a/cmake/dependencies/Boost.cmake b/cmake/dependencies/Boost.cmake
index 366d32b..7ff041b 100644
--- a/cmake/dependencies/Boost.cmake
+++ b/cmake/dependencies/Boost.cmake
@@ -10,4 +10,6 @@ endif()
set(Boost_RELEASE_VERSION
"${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
+set(BOOST_FOUND "${Boost_FOUND}")
+set(BOOST_LIBRARIES "${Boost_LIBRARIES}")
boost_external_report(Boost RELEASE_VERSION INCLUDE_DIR LIBRARIES)
diff --git a/cmake/dependencies/MySQL.cmake b/cmake/dependencies/MySQL.cmake
index 5599b08..0a4ce0f 100644
--- a/cmake/dependencies/MySQL.cmake
+++ b/cmake/dependencies/MySQL.cmake
@@ -1,5 +1,9 @@
set(MySQL_FIND_QUIETLY TRUE)
-find_package(MySQL)
+find_package(MYSQL NAMES unofficial-libmysql REQUIRED)
+set(MYSQL_LIBRARIES "$<TARGET_NAME:libmysql>")
+if(TARGET mysqlclient AND NOT TARGET libmysql)
+ set(MYSQL_LIBRARIES "$<TARGET_NAME:mysqlclient>")
+endif()
boost_external_report(MySQL INCLUDE_DIR LIBRARIES)
diff --git a/cmake/dependencies/PostgreSQL.cmake b/cmake/dependencies/PostgreSQL.cmake
index c6f2154..ef6bfcd 100644
--- a/cmake/dependencies/PostgreSQL.cmake
+++ b/cmake/dependencies/PostgreSQL.cmake
@@ -1,5 +1,8 @@
set(PostgreSQL_FIND_QUIETLY TRUE)
-find_package(PostgreSQL)
+find_package(PostgreSQL REQUIRED)
+set(POSTGRESQL_FOUND TRUE)
+set(POSTGRESQL_INCLUDE_DIRS "${PostgreSQL_INCLUDE_DIRS}")
+set(POSTGRESQL_LIBRARIES "${PostgreSQL_LIBRARIES}")
boost_external_report(PostgreSQL INCLUDE_DIRS LIBRARIES VERSION)
diff --git a/cmake/dependencies/SQLite3.cmake b/cmake/dependencies/SQLite3.cmake
index 0daa9a5..17775da 100644
--- a/cmake/dependencies/SQLite3.cmake
+++ b/cmake/dependencies/SQLite3.cmake
@@ -1,5 +1,6 @@
set(SQLITE3_FIND_QUIETLY TRUE)
-find_package(SQLite3)
+find_package(SQLITE3 NAMES unofficial-sqlite3 CONFIG REQUIRED)
+set(SQLITE3_LIBRARIES unofficial::sqlite3::sqlite3)
boost_external_report(SQLite3 INCLUDE_DIR LIBRARIES)
diff --git a/cmake/resources/SOCIConfig.cmake.in b/cmake/resources/SOCIConfig.cmake.in
index 8096a3c..354c18b 100644
--- a/cmake/resources/SOCIConfig.cmake.in
+++ b/cmake/resources/SOCIConfig.cmake.in
@@ -1,3 +1,11 @@
@PACKAGE_INIT@
+include(CMakeFindDependencyMacro)
+if("@WITH_MYSQL@")
+ find_dependency(unofficial-libmysql)
+endif()
+if("@WITH_SQLITE3@")
+ find_dependency(unofficial-sqlite3)
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/SOCITargets.cmake)
diff --git a/include/soci/mysql/soci-mysql.h b/include/soci/mysql/soci-mysql.h
index 376bb7e..fbe48fa 100644
--- a/include/soci/mysql/soci-mysql.h
+++ b/include/soci/mysql/soci-mysql.h
@@ -21,8 +21,8 @@
#ifdef _WIN32
#include <winsock.h> // SOCKET
#endif // _WIN32
-#include <mysql.h> // MySQL Client
-#include <errmsg.h> // MySQL Error codes
+#include <mysql/mysql.h> // MySQL Client
+#include <mysql/errmsg.h> // MySQL Error codes
#include <vector>
diff --git a/src/backends/CMakeLists.txt b/src/backends/CMakeLists.txt
index 871e151..3cffc80 100644
--- a/src/backends/CMakeLists.txt
+++ b/src/backends/CMakeLists.txt
@@ -14,9 +14,9 @@ colormsg(_HIBLUE_ "Configuring SOCI backend libraries:")
foreach(dep ${SOCI_BACKENDS_DB_DEPENDENCIES})
string(TOUPPER ${dep} depUP)
if (WITH_${depUP})
- find_package(${dep})
- endif()
- if(${dep}_FOUND OR ${depUP}_FOUND)
+ if(NOT (${dep}_FOUND OR ${depUP}_FOUND))
+ message(FATAL_ERROR "${depUP} not found, check SociDependencies.cmake")
+ endif()
set(${depUP}_FOUND ON)
else()
set(${depUP}_FOUND OFF)

View File

@ -2,71 +2,66 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO SOCI/soci
REF "v${VERSION}"
SHA512 d501f55e7e7408e46b4823fd8a97d6ef587f5db0f5b98434be8dfc5693c91b8c3b84a24454279c83142ab1cd1fa139c6e54d6d9a67397b2ead61650fcc88bcdb
SHA512 0553fb7856c77158b229c33fb7a14402f9d740825db5b0c0c4cbbbc2596faa56b099f7e13bece5af506311c393e6fcb4e8b448522d15bba57c6dd0d23e6467c1
HEAD_REF master
PATCHES
dependencies.diff
usage-requirements.diff
)
file(REMOVE
"${SOURCE_PATH}/cmake/modules/FindPostgreSQL.cmake"
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" SOCI_DYNAMIC)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SOCI_STATIC)
vcpkg_check_features(OUT_FEATURE_OPTIONS options
FEATURES
boost WITH_BOOST
boost CMAKE_REQUIRE_FIND_PACKAGE_Boost
empty SOCI_EMPTY
mysql WITH_MYSQL
odbc WITH_ODBC
odbc CMAKE_REQUIRE_FIND_PACKAGE_ODBC
postgresql WITH_POSTGRESQL
sqlite3 WITH_SQLITE3
INVERTED_FEATURES
core WITH_DB2
core WITH_FIREBIRD
core WITH_ORACLE
core WITH_VALGRIND
mysql SOCI_MYSQL
odbc SOCI_ODBC
postgresql SOCI_POSTGRESQL
sqlite3 SOCI_SQLITE3
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DSOCI_CXX11=ON
-DSOCI_SHARED=${SOCI_DYNAMIC}
-DSOCI_STATIC=${SOCI_STATIC}
-DSOCI_TESTS=OFF
-DSOCI_INSTALL=ON
-DSOCI_FMT_BUILTIN=OFF
# SOCI components whose backends are not yet available through vcpkg
-DSOCI_DB2=OFF
-DSOCI_FIREBIRD=OFF
-DSOCI_ORACLE=OFF
${options}
MAYBE_UNUSED_VARIABLES
CMAKE_REQUIRE_FIND_PACKAGE_Boost
CMAKE_REQUIRE_FIND_PACKAGE_ODBC
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SOCI)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/soci-${VERSION})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
# Needed to be consumable without CMake (which sets the macro automatically)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/soci/soci-platform.h" "ifdef SOCI_DLL" "if 1")
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(READ "${CURRENT_PORT_DIR}/usage" usage)
set(backends ${FEATURES})
list(REMOVE_ITEM backends core boost)
if(backends STREQUAL "")
string(APPEND usage "
This soci build doesn't include any backend and may not be useful.
This SOCI build doesn't include any backend and may not be useful.
")
else()
string(APPEND usage "
# This version of SOCI was built with support for these components:
# - core
")
endif()
foreach(backend IN LISTS backends)
string(APPEND usage "
# Using the ${backend} backend directly
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_${backend}>,SOCI::soci_${backend},SOCI::soci_${backend}_static>)
string(APPEND usage " # - ${backend}
")
endforeach()
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage}")

View File

@ -1,5 +1,6 @@
soci provides CMake targets:
find_package(SOCI CONFIG REQUIRED)
# Using core (loading backends at runtime)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_core>,SOCI::soci_core,SOCI::soci_core_static>)
# Not specifying a component implies linkage against all available components
# Core component is always implied
find_package(SOCI 4.1 COMPONENTS Core CONFIG REQUIRED)
target_link_libraries(main PRIVATE SOCI::SOCI)

View File

@ -1,33 +0,0 @@
diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake
index 5d4ef0d..279cb75 100644
--- a/cmake/SociBackend.cmake
+++ b/cmake/SociBackend.cmake
@@ -159,8 +159,13 @@ macro(soci_backend NAME)
${THIS_BACKEND_HEADERS})
target_link_libraries(${THIS_BACKEND_TARGET}
+ PUBLIC
${SOCI_CORE_TARGET}
${THIS_BACKEND_DEPENDS_LIBRARIES})
+ target_include_directories(${THIS_BACKEND_TARGET}
+ PUBLIC
+ ${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}
+ )
if(WIN32)
set_target_properties(${THIS_BACKEND_TARGET}
@@ -197,8 +202,14 @@ macro(soci_backend NAME)
# Still need to link the libraries for tests to work
target_link_libraries (${THIS_BACKEND_TARGET_STATIC}
+ PUBLIC
+ ${SOCI_CORE_TARGET}_static
${THIS_BACKEND_DEPENDS_LIBRARIES}
)
+ target_include_directories(${THIS_BACKEND_TARGET_STATIC}
+ PUBLIC
+ ${THIS_BACKEND_DEPENDS_INCLUDE_DIRS}
+ )
set_target_properties(${THIS_BACKEND_TARGET_STATIC}
PROPERTIES

View File

@ -1,11 +1,11 @@
{
"name": "soci",
"version": "4.0.3",
"port-version": 3,
"version": "4.1.4",
"description": "SOCI - The C++ Database Access Library",
"homepage": "https://soci.sourceforge.net/",
"license": "BSL-1.0",
"dependencies": [
"fmt",
{
"name": "vcpkg-cmake",
"host": true
@ -30,13 +30,13 @@
"description": "Build the backend skeleton for new backends development"
},
"mysql": {
"description": "Build mysql backend",
"description": "Include MySQL support",
"dependencies": [
"libmysql"
]
},
"odbc": {
"description": "Build odbc backend",
"description": "Include ODBC support",
"supports": "!uwp",
"dependencies": [
{
@ -46,7 +46,7 @@
]
},
"postgresql": {
"description": "Build postgresql backend",
"description": "Include PostgreSQL support",
"dependencies": [
{
"name": "libpq",
@ -55,7 +55,7 @@
]
},
"sqlite3": {
"description": "Build sqlite3 backend",
"description": "Include SQLite3 support",
"dependencies": [
{
"name": "sqlite3",

View File

@ -1332,8 +1332,9 @@ sleepy-discord[voice]:arm64-linux=cascade
sleepy-discord(android)=fail
slikenet:arm64-linux=fail
smpeg2:arm64-linux=cascade
soci[mysql]:x86-windows=cascade
soci[odbc]:arm64-linux=feature-fails # Could NOT find ODBC
soci[odbc]:arm64-windows=feature-fails # Internal compiler error in release mode
soci[postgresql]:arm64-windows=feature-fails # Internal compiler error in release mode
soem:arm64-windows=cascade
soem:x64-windows-static-md=cascade
soem:x64-windows-static=cascade

View File

@ -7,7 +7,5 @@ endif()
add_executable(main main.cpp)
find_package(SOCI CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_mysql>,SOCI::soci_mysql,SOCI::soci_mysql_static>)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_postgresql>,SOCI::soci_postgresql,SOCI::soci_postgresql_static>)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_sqlite3>,SOCI::soci_sqlite3,SOCI::soci_sqlite3_static>)
find_package(SOCI 4.1 COMPONENTS MySQL PostgreSQL SQLite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE SOCI::SOCI)

View File

@ -9493,8 +9493,8 @@
"port-version": 0
},
"soci": {
"baseline": "4.0.3",
"port-version": 3
"baseline": "4.1.4",
"port-version": 0
},
"sockpp": {
"baseline": "1.0.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "830981cf487e7150fc4309c6c66ae7763a47329b",
"version": "4.1.4",
"port-version": 0
},
{
"git-tree": "24c340284022dab38da690548caa65c4f003bb7c",
"version": "4.0.3",