From 23da0b60f5a9e3f10eb6b7430f2a8eb0c8316f53 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 26 Apr 2011 15:39:05 +0100 Subject: [PATCH] cmake: always enable GNU and recent-POSIX extensions, like autoconf does Not doing this broke the cmake build on Linux, where SO_PEERCRED is defined unconditionally, but struct ucred is considered to be a GNU extension. --- cmake/CMakeLists.txt | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 13cdb74..025ece4 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -94,6 +94,9 @@ endif(NOT WIN32) #AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE) OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF) +# analogous to AC_USE_SYSTEM_EXTENSIONS +add_definitions(-D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE) + # do config checks INCLUDE(ConfigureChecks.cmake) @@ -239,9 +242,9 @@ endif(WIN32) OPTION(DBUS_ENABLE_ANSI "enable -ansi -pedantic gcc flags" OFF) if(DBUS_ENABLE_ANSI) if(NOT MSVC) - add_definitions(-ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic) + add_definitions(-ansi -pedantic) else(NOT MSVC) - add_definitions(-Za -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -W4) + add_definitions(-Za -W4) endif(NOT MSVC) endif(DBUS_ENABLE_ANSI) -- 1.7.4.4