Skip to content

Commit

Permalink
Fixes #851 (#852)
Browse files Browse the repository at this point in the history
Thanks @tt4g.
  • Loading branch information
jtv authored Jun 23, 2024
1 parent 7569caf commit 0444b8b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

3 comments on commit 0444b8b

@BillyONeal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stupid question: Why don't you have CXX in the project call? That should make this CMake internal implementation detail not matter...

@tt4g
Copy link
Contributor

@tt4g tt4g commented on 0444b8b Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillyONeal It is already declared in the project root CMakeLists.txt.

libpqxx/CMakeLists.txt

Lines 6 to 10 in 30d41bc

project(
libpqxx
VERSION ${VER_FILE_CONTENT}
LANGUAGES CXX
)

And we are currently making further improvements in #851.

@BillyONeal
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. I tried 😅. Thanks!

Please sign in to comment.