diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libssh/0001-export-pkgconfig-file.patch | |
Diffstat (limited to 'vcpkg/ports/libssh/0001-export-pkgconfig-file.patch')
| -rw-r--r-- | vcpkg/ports/libssh/0001-export-pkgconfig-file.patch | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/vcpkg/ports/libssh/0001-export-pkgconfig-file.patch b/vcpkg/ports/libssh/0001-export-pkgconfig-file.patch new file mode 100644 index 0000000..3c5d146 --- /dev/null +++ b/vcpkg/ports/libssh/0001-export-pkgconfig-file.patch @@ -0,0 +1,75 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9877cd7..5177904 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,8 +42,11 @@ macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source buil + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") + + # search for libraries ++set(PC_LIBS_PRIVATE "") ++set(PC_REQUIRES_PRIVATE "") + if (WITH_ZLIB) + find_package(ZLIB REQUIRED) ++ string(APPEND PC_REQUIRES_PRIVATE "zlib") + endif (WITH_ZLIB) + + if (WITH_GCRYPT) +@@ -53,6 +56,7 @@ elseif(WITH_MBEDTLS) + find_package(MbedTLS REQUIRED) + else() + find_package(OpenSSL 1.1.1 REQUIRED) ++ string(APPEND PC_REQUIRES_PRIVATE " libcrypto") + endif() + + if (UNIT_TESTING) +@@ -96,7 +100,7 @@ add_subdirectory(include) + add_subdirectory(src) + + # pkg-config file +-if (UNIX OR MINGW) ++if (1) + configure_file(libssh.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libssh.pc @ONLY) + install( + FILES +@@ -106,7 +110,7 @@ install( + COMPONENT + pkgconfig + ) +-endif (UNIX OR MINGW) ++endif (1) + + # CMake config files + include(CMakePackageConfigHelpers) +diff --git a/libssh.pc.cmake b/libssh.pc.cmake +index f288b94..759525c 100644 +--- a/libssh.pc.cmake ++++ b/libssh.pc.cmake +@@ -7,4 +7,6 @@ Name: @PROJECT_NAME@ + Description: The SSH Library + Version: @PROJECT_VERSION@ + Libs: -L${libdir} -lssh ++Libs.private: @PC_LIBS_PRIVATE@ ++Requires.private: @PC_REQUIRES_PRIVATE@ + Cflags: -I${includedir} +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e0243bb..b17d9e2 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -54,6 +54,8 @@ if (MINGW AND Threads_FOUND) + ${LIBSSH_LINK_LIBRARIES} + Threads::Threads + ) ++ string(APPEND PC_LIBS_PRIVATE " ${CMAKE_THREAD_LIBS_INIT}") ++ set(PC_LIBS_PRIVATE "${PC_LIBS_PRIVATE}" PARENT_SCOPE) + endif() + + # The ws2_32 needs to be last for mingw to build +@@ -64,6 +66,8 @@ if (WIN32) + iphlpapi + ws2_32 + ) ++ string(APPEND PC_LIBS_PRIVATE " -liphlpapi -lws2_32 -lshell32 -ladvapi32") ++ set(PC_LIBS_PRIVATE "${PC_LIBS_PRIVATE}" PARENT_SCOPE) + endif (WIN32) + + if (BUILD_STATIC_LIB) |