File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,18 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
1515set (THREADS_PREFER_PTHREAD_FLAG ON )
1616find_package (Threads REQUIRED)
1717
18+ if (NOT CMAKE_CROSSCOMPILING )
19+ execute_process (
20+ COMMAND xcrun --sdk macosx --show-sdk-version
21+ OUTPUT_VARIABLE OS_DARWIN_SDK_VERSION
22+ OUTPUT_STRIP_TRAILING_WHITESPACE
23+ )
24+ if (${OS_DARWIN_SDK_VERSION} MATCHES "^[0-9]+\\ .[0-9]+" )
25+ message (STATUS "Detected OSX SDK Version: ${OS_DARWIN_SDK_VERSION} " )
26+ else ()
27+ message (WARNING "Unexpected OSX SDK Version: ${OS_DARWIN_SDK_VERSION} " )
28+ endif ()
29+ endif ()
30+
1831include (cmake/unwind.cmake)
19- include (cmake/cxx.cmake)
32+ include (cmake/cxx.cmake)
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ if (OS_DARWIN OR OS_FREEBSD OR USE_MUSL)
7979 target_compile_definitions (_libpq PRIVATE -DSTRERROR_R_INT=1)
8080endif ()
8181
82+ # Mac 15.4 / Xcode 16.3 started defining srtchrnul
83+ # Could be cleaned up if properly resolved in upstream
84+ # https://www.postgresql.org/message-id/flat/385134.1743523038%40sss.pgh.pa.us
85+ if (OS_DARWIN AND OS_DARWIN_SDK_VERSION AND OS_DARWIN_SDK_VERSION VERSION_GREATER_EQUAL 15.4)
86+ target_compile_definitions (_libpq PRIVATE -DHAVE_STRCHRNUL)
87+ endif ()
88+
8289target_link_libraries (_libpq PRIVATE OpenSSL::SSL)
8390
8491add_library (ch_contrib::libpq ALIAS _libpq)
You can’t perform that action at this time.
0 commit comments