diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2020-10-22 21:56:51 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-22 21:56:51 -0700 |
| commit | de299679d984fe7aa945d3d66f8dec2729dc0304 (patch) | |
| tree | 056e2e77d75cbaa1c6de8b2d145b0e36d96f66f4 /ports/libpq | |
| parent | d6032b525870f30d21aeb144e655a8e8fcba8736 (diff) | |
| download | vcpkg-de299679d984fe7aa945d3d66f8dec2729dc0304.tar.gz vcpkg-de299679d984fe7aa945d3d66f8dec2729dc0304.zip | |
[libpq] Fix incidental linkage of DL on windows platforms. (#14172)
Previously, detecting the presence of the dlfcn-win32 library resulted in an incorrect `-ldl` injection.
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'ports/libpq')
| -rw-r--r-- | ports/libpq/CONTROL | 4 | ||||
| -rw-r--r-- | ports/libpq/portfile.cmake | 28 | ||||
| -rw-r--r-- | ports/libpq/vcpkg-cmake-wrapper.cmake | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/ports/libpq/CONTROL b/ports/libpq/CONTROL index ab2447379..f55423ec5 100644 --- a/ports/libpq/CONTROL +++ b/ports/libpq/CONTROL @@ -1,7 +1,7 @@ Source: libpq Version: 12.2 -Port-Version: 7 -Build-Depends: libpq[bonjour] (osx) +Port-Version: 8 +Build-Depends: libpq[core,bonjour] (osx) Supports: !uwp Homepage: https://www.postgresql.org/ Description: The official database access API of postgresql diff --git a/ports/libpq/portfile.cmake b/ports/libpq/portfile.cmake index 4c8f4fa8f..442fa199b 100644 --- a/ports/libpq/portfile.cmake +++ b/ports/libpq/portfile.cmake @@ -240,7 +240,7 @@ if(VCPKG_TARGET_IS_WINDOWS) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/symbols) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/symbols) - if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) endif() @@ -251,16 +251,23 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() message(STATUS "Cleanup libpq ${TARGET_TRIPLET}... - done") + set(USE_DL OFF) else() file(COPY ${CMAKE_CURRENT_LIST_DIR}/Makefile DESTINATION ${SOURCE_PATH}) - if("${FEATURES}" MATCHES "openssl") + if("openssl" IN_LIST FEATURES) list(APPEND BUILD_OPTS --with-openssl) + else() + list(APPEND BUILD_OPTS --without-openssl) endif() - if(NOT "${FEATURES}" MATCHES "zlib") + if("zlib" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-zlib) + else() list(APPEND BUILD_OPTS --without-zlib) endif() - if(NOT "${FEATURES}" MATCHES "readline") + if("readline" IN_LIST FEATURES) + list(APPEND BUILD_OPTS --with-readline) + else() list(APPEND BUILD_OPTS --without-readline) endif() vcpkg_configure_make( @@ -276,7 +283,7 @@ else() --enable-debug ) - if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") set(ENV{LIBPQ_LIBRARY_TYPE} shared) else() set(ENV{LIBPQ_LIBRARY_TYPE} static) @@ -292,15 +299,8 @@ else() file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/${PORT}) file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/${PORT}) endif() + set(USE_DL ON) endif() -#vcpkg_copy_pdbs() - -#if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.lib") - #RENAME debug library due to CMake. In general that is a bad idea but it will have consquences for the generated cmake targets - # of other ports if not renamed. Maybe a vcpkg_cmake_wrapper is required here to correct the target information if the rename is removed? -# file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/libpq.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/libpqd.lib") -#endif() -file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/postgresql) -file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/postgresql) +configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/postgresql/vcpkg-cmake-wrapper.cmake @ONLY) file(INSTALL ${SOURCE_PATH}/COPYRIGHT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/libpq/vcpkg-cmake-wrapper.cmake b/ports/libpq/vcpkg-cmake-wrapper.cmake index 5fd40d26c..352954ef5 100644 --- a/ports/libpq/vcpkg-cmake-wrapper.cmake +++ b/ports/libpq/vcpkg-cmake-wrapper.cmake @@ -6,7 +6,7 @@ PATHS NO_DEFAULT_PATH
)
_find_package(${ARGS})
-if(PostgreSQL_FOUND)
+if(PostgreSQL_FOUND AND @USE_DL@)
find_library(PostgreSQL_DL_LIBRARY NAMES dl)
if(PostgreSQL_DL_LIBRARY)
list(APPEND PostgreSQL_LIBRARIES "dl")
|
