File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,25 @@ 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 after resolved in upstream https://www.postgresql.org/message-id/flat/385134.1743523038%40sss.pgh.pa.us
84+ if (OS_DARWIN AND NOT USE_MUSL)
85+ execute_process (
86+ COMMAND xcrun --sdk macosx --show-sdk-version
87+ OUTPUT_VARIABLE XCRUN
88+ OUTPUT_STRIP_TRAILING_WHITESPACE
89+ )
90+
91+ string (REGEX MATCH "([0-9]+)\\ .([0-9]+)" _ ${XCRUN} )
92+ set (SDK_VERSION_MAJOR "${CMAKE_MATCH_1} " )
93+ set (SDK_VERSION_MINOR "${CMAKE_MATCH_2} " )
94+
95+ message (STATUS "Detected SDK Version: ${SDK_VERSION_MAJOR} .${SDK_VERSION_MINOR} " )
96+ if (SDK_VERSION_MAJOR GREATER 15 OR (SDK_VERSION_MAJOR EQUAL 15 AND SDK_VERSION_MINOR GREATER_EQUAL 4))
97+ target_compile_definitions (_libpq PRIVATE -DHAVE_STRCHRNUL)
98+ endif ()
99+ endif ()
100+
82101target_link_libraries (_libpq PRIVATE OpenSSL::SSL)
83102
84103add_library (ch_contrib::libpq ALIAS _libpq)
You can’t perform that action at this time.
0 commit comments