-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[package] soci/*: Backends don't link against required libraries #11628
Labels
bug
Something isn't working
Comments
I've worked around this with this terrible patch for now: diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake
index b52f1de..7c8f21f 100644
--- a/cmake/SociBackend.cmake
+++ b/cmake/SociBackend.cmake
@@ -65,7 +65,7 @@ endmacro()
#
macro(soci_backend NAME)
parse_arguments(THIS_BACKEND
- "DEPENDS;DESCRIPTION;AUTHORS;MAINTAINERS;"
+ "DEPENDS;DESCRIPTION;AUTHORS;MAINTAINERS;TARGET_DEPENDS"
""
${ARGN})
@@ -161,7 +161,7 @@ macro(soci_backend NAME)
target_link_libraries(${THIS_BACKEND_TARGET}
${SOCI_CORE_TARGET}
- ${THIS_BACKEND_DEPENDS_LIBRARIES})
+ ${THIS_BACKEND_TARGET_DEPENDS})
if(WIN32)
set_target_properties(${THIS_BACKEND_TARGET}
@@ -198,7 +198,7 @@ macro(soci_backend NAME)
# Still need to link the libraries for tests to work
target_link_libraries (${THIS_BACKEND_TARGET_STATIC}
- ${THIS_BACKEND_DEPENDS_LIBRARIES}
+ ${THIS_BACKEND_TARGET_DEPENDS}
)
set_target_properties(${THIS_BACKEND_TARGET_STATIC}
diff --git a/src/backends/mysql/CMakeLists.txt b/src/backends/mysql/CMakeLists.txt
index b2dcc9c..54814e8 100644
--- a/src/backends/mysql/CMakeLists.txt
+++ b/src/backends/mysql/CMakeLists.txt
@@ -12,4 +12,5 @@ soci_backend(MySQL
DEPENDS MySQL
DESCRIPTION "SOCI backend for MySQL"
AUTHORS "Pawel Aleksander Fedorynski"
- MAINTAINERS "Pawel Aleksander Fedorynski")
+ MAINTAINERS "Pawel Aleksander Fedorynski"
+ TARGET_DEPENDS MySQL::MySQL)
diff --git a/src/backends/odbc/CMakeLists.txt b/src/backends/odbc/CMakeLists.txt
index ce01953..bd01641 100644
--- a/src/backends/odbc/CMakeLists.txt
+++ b/src/backends/odbc/CMakeLists.txt
@@ -12,4 +12,5 @@ soci_backend(ODBC
DEPENDS ODBC
DESCRIPTION "SOCI backend for ODBC"
AUTHORS "Maciej Sobczak, Stephen Hutton, David Courtney"
- MAINTAINERS "Vadim Zeitlin, Mateusz Loskot, Maciej Sobczak")
+ MAINTAINERS "Vadim Zeitlin, Mateusz Loskot, Maciej Sobczak"
+ TARGET_DEPENDS objectbox::objectbox)
diff --git a/src/backends/postgresql/CMakeLists.txt b/src/backends/postgresql/CMakeLists.txt
index 44c27d3..ae5b185 100644
--- a/src/backends/postgresql/CMakeLists.txt
+++ b/src/backends/postgresql/CMakeLists.txt
@@ -27,6 +27,7 @@ soci_backend(PostgreSQL
DEPENDS PostgreSQL
DESCRIPTION "SOCI backend for PostgreSQL"
AUTHORS "Maciej Sobczak, Stephen Hutton"
- MAINTAINERS "Mateusz Loskot")
+ MAINTAINERS "Mateusz Loskot"
+ TARGET_DEPENDS PostgreSQL::PostgreSQL)
boost_report_value(SOCI_POSTGRESQL_NOSINLGEROWMODE)
diff --git a/src/backends/sqlite3/CMakeLists.txt b/src/backends/sqlite3/CMakeLists.txt
index cd90b7a..14ab1c4 100644
--- a/src/backends/sqlite3/CMakeLists.txt
+++ b/src/backends/sqlite3/CMakeLists.txt
@@ -13,4 +13,5 @@ soci_backend(SQLite3
DEPENDS SQLite3
DESCRIPTION "SOCI backend for SQLite 3"
AUTHORS "Maciej Sobczak, Stephen Hutton, David Courtney"
- MAINTAINERS "Maciej Sobczak, Mateusz Loskot")
+ MAINTAINERS "Maciej Sobczak, Mateusz Loskot"
+ TARGET_DEPENDS SQLite::SQLite) |
@Cogitri Here is my patch, diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake
index 5d4ef0d..1abd642 100644
--- a/cmake/SociBackend.cmake
+++ b/cmake/SociBackend.cmake
@@ -38,7 +38,7 @@ macro(soci_backend_deps_found NAME DEPS SUCCESS)
if( ${DEPU}_INCLUDE_DIRS )
list(APPEND DEPS_INCLUDE_DIRS ${${DEPU}_INCLUDE_DIRS})
endif()
- list(APPEND DEPS_LIBRARIES ${${DEPU}_LIBRARIES})
+ list(APPEND DEPS_LIBRARIES ${${dep}_LIBRARIES})
endif()
endforeach() |
Cogitri
added a commit
to dampsoft/conan-center-index
that referenced
this issue
Apr 26, 2023
soci searches for POSTGRESQL_LIBRARIES etc. instead of what conan defines (PostgreSQL_LIBRARIES). fixes conan-io#11628
2 tasks
conan-center-bot
pushed a commit
that referenced
this issue
Apr 30, 2023
pezy
pushed a commit
to pezy/conan-center-index
that referenced
this issue
Jun 1, 2023
* soci: fix linking against dependencies with conanv1 soci searches for POSTGRESQL_LIBRARIES etc. instead of what conan defines (PostgreSQL_LIBRARIES). fixes conan-io#11628 * soci: fix @rpath on MacOS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Package and Environment Details
The soci PostgreSQL and SQLite backend (and probably the other backends too) don't link against the respective required DB-library. During configuration SOCI's CMake prints:
I think SOCI's
FindPostgreSQL
andFindSQLite3
modules don't play nice with Conan's autogenerated find_package scripts.Conan profile
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=12
compiler.libcxx=libstdc++
build_type=Release
compiler.cppstd=17
[options]
[conf]
[build_requires]
[env]
Steps to reproduce
cd recipes/soci/all
conan create -o libpq:shared=True -o sqlite3:shared=True -o soci:shared=True -o soci:with_sqlite3=True soci:with_postgresql=True . 4.0.3@
ldd $HOME/.conan/data/soci/4.0.3///package/7fdc17dbbac95ba346436d0e26b435bbc5a3330d/lib/libsoci_postgresql.so # Doesn't print libpq
Logs
Click to expand log
The text was updated successfully, but these errors were encountered: