# HG changeset patch # User Sebastien Jodogne # Date 1503651993 -7200 # Node ID 0ca5a383a8303116ddb2a8141734449bfd89fd42 # Parent 1149cefd1ceeb99e0c196f3dc11af8f321b7bf3f fix OS X build diff -r 1149cefd1cee -r 0ca5a383a830 Resources/CMake/PostgreSQLConfiguration.cmake --- a/Resources/CMake/PostgreSQLConfiguration.cmake Thu Aug 24 20:26:27 2017 +0200 +++ b/Resources/CMake/PostgreSQLConfiguration.cmake Fri Aug 25 11:06:33 2017 +0200 @@ -154,20 +154,28 @@ set(FLEXIBLE_ARRAY_MEMBER "/**/") endif() - file(READ ${CMAKE_SOURCE_DIR}/Resources/Platforms/printf_archetype.c SOURCE) - check_c_source_compiles("${SOURCE}" printf_archetype) - if (printf_archetype AND - NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND - NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - set(PG_PRINTF_ATTRIBUTE "gnu_printf") + if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR + CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR + CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + set(PG_PRINTF_ATTRIBUTE "printf") else() - set(PG_PRINTF_ATTRIBUTE "printf") + file(READ ${CMAKE_SOURCE_DIR}/Resources/Platforms/printf_archetype.c SOURCE) + check_c_source_compiles("${SOURCE}" printf_archetype) + if (printf_archetype) + set(PG_PRINTF_ATTRIBUTE "gnu_printf") + else() + set(PG_PRINTF_ATTRIBUTE "printf") + endif() endif() - check_function_exists("unsetenv" HAVE_UNSETENV) check_function_exists("getaddrinfo" HAVE_GETADDRINFO) check_function_exists("gettimeofday" HAVE_GETTIMEOFDAY) + check_function_exists("snprintf" HAVE_DECL_SNPRINTF) check_function_exists("srandom" HAVE_SRANDOM) + check_function_exists("strlcat" HAVE_DECL_STRLCAT) + check_function_exists("strlcpy" HAVE_DECL_STRLCPY) + check_function_exists("unsetenv" HAVE_UNSETENV) + check_function_exists("vsnprintf" HAVE_DECL_VSNPRINTF) check_type_size("struct addrinfo" SIZE_STRUCT_ADDRINFO) if (HAVE_SIZE_STRUCT_ADDRINFO)