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

[libpqxx] Fix building libpqxx 7.9.0 with cmake 3.30 #39927

Merged
merged 2 commits into from
Jul 15, 2024
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
42 changes: 42 additions & 0 deletions ports/libpqxx/fix_build_cmake_3.30.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From d5bf7cf83d0c86c502b6b30d5f0c8dc3b3049a38 Mon Sep 17 00:00:00 2001
From: Jeroen Vermeulen <[email protected]>
Date: Sun, 23 Jun 2024 21:03:24 +0200
Subject: [PATCH] Fixes https://github.com/jtv/libpqxx/issues/851

Thanks @tt4g.
---
cmake/config.cmake | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/cmake/config.cmake b/cmake/config.cmake
index ef2ebf5fc..4d9f7e935 100644
--- a/cmake/config.cmake
+++ b/cmake/config.cmake
@@ -8,10 +8,18 @@ function(detect_code_compiled code macro msg)
endif()
endfunction(detect_code_compiled)

+if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0)
+ include(CMakeDetermineCompilerSupport)
+ cmake_determine_compiler_support(CXX)
+else()
+ # This function changed names in CMake 3.30. :-(
+ include(CMakeDetermineCompileFeatures)
+ cmake_determine_compile_features(CXX)
+endif()
+
include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(CheckSymbolExists)
-include(CMakeDetermineCompileFeatures)
include(CheckCXXSourceCompiles)
include(CMakeFindDependencyMacro)

@@ -39,7 +47,6 @@ check_function_exists("poll" PQXX_HAVE_POLL)

set(CMAKE_REQUIRED_LIBRARIES pq)

-cmake_determine_compile_features(CXX)
cmake_policy(SET CMP0057 NEW)

# check_cxx_source_compiles requires CMAKE_REQUIRED_DEFINITIONS to specify
1 change: 1 addition & 0 deletions ports/libpqxx/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix_build_with_vs2017.patch
fix_build_cmake_3.30.patch # remove with > 7.9.1, upstream fix: https://github.com/jtv/libpqxx/commit/d5bf7cf83d0c86c502b6b30d5f0c8dc3b3049a38
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/config-public-compiler.h.in" DESTINATION "${SOURCE_PATH}")
Expand Down
1 change: 1 addition & 0 deletions ports/libpqxx/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libpqxx",
"version": "7.9.0",
"port-version": 1,
"description": "The official C++ client API for PostgreSQL",
"homepage": "https://www.postgresql.org/",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4874,7 +4874,7 @@
},
"libpqxx": {
"baseline": "7.9.0",
"port-version": 0
"port-version": 1
},
"libprotobuf-mutator": {
"baseline": "1.3",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libpqxx.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "36fb80efda7137194f2bf679b9e685e9dab60bb5",
"version": "7.9.0",
"port-version": 1
},
{
"git-tree": "c8078815fcddf1da8e7d8fba66100befaa779ec0",
"version": "7.9.0",
Expand Down