Skip to content
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

[soci] Fix usage #34436

Merged
merged 2 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ports/soci/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,20 @@ 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 "")
message(STATUS "Attention:\n\nThis soci build doesn't include any backends.\n")
set(backends "none")
string(APPEND usage "
This soci build doesn't include any backend and may not be useful.
")
endif()
configure_file("${CURRENT_PORT_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
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>)
")
endforeach()
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" "${usage}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE_1_0.txt")
6 changes: 2 additions & 4 deletions ports/soci/usage
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
soci provides CMake targets:

find_package(soci CONFIG REQUIRED)
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>)

# Linking specific backends (enabled: @backends@)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SOCI::soci_<BACKEND>,SOCI::soci_<BACKEND>,SOCI::soci_<BACKEND>_static>)
2 changes: 1 addition & 1 deletion ports/soci/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "soci",
"version": "4.0.3",
"port-version": 2,
"port-version": 3,
"description": "SOCI - The C++ Database Access Library",
"homepage": "https://soci.sourceforge.net/",
"license": "BSL-1.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7818,7 +7818,7 @@
},
"soci": {
"baseline": "4.0.3",
"port-version": 2
"port-version": 3
},
"socket-io-client": {
"baseline": "2023-02-14",
Expand Down
5 changes: 5 additions & 0 deletions versions/s-/soci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "24c340284022dab38da690548caa65c4f003bb7c",
"version": "4.0.3",
"port-version": 3
},
{
"git-tree": "63f4471adc41e108aed34cd585a06e354f1b4762",
"version": "4.0.3",
Expand Down