summaryrefslogtreecommitdiff
path: root/cmake/CMakeLists.txt
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-07-27 15:59:53 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-08-05 14:17:51 +0100
commitc1bcd2269c590305cad42e000cd39fad49158e3e (patch)
treec5ba59ac7adcf414f6ea75e762459dc71028103a /cmake/CMakeLists.txt
parent2dfee7317cad8b189dea42e44f1082fb6d91bfe3 (diff)
downloaddbus-c1bcd2269c590305cad42e000cd39fad49158e3e.tar.gz
dbus-c1bcd2269c590305cad42e000cd39fad49158e3e.tar.bz2
dbus-c1bcd2269c590305cad42e000cd39fad49158e3e.zip
cmake: always enable GNU and recent-POSIX extensions, like autoconf does
If the C library is (e)glibc, this allows use of POSIX, BSD, SVID, GNU, etc., extensions to ISO C, regardless of using -ansi or not. Not doing this broke the cmake build on Linux since commit 18b08180, which added AC_USE_SYSTEM_EXTENSIONS to configure.ac (and removed _GNU_SOURCE from files that use it) without also updating the cmake build system. SO_PEERCRED is defined unconditionally, but struct ucred is considered to be a GNU extension, so can't be used under _GNU_SOURCE. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29228 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r--cmake/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 04f318a3..750e3f1a 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -100,6 +100,9 @@ OPTION(DBUS_DISABLE_ASSERTS "Disable assertion checking" OFF)
option (DBUS_ENABLE_STATS "enable bus daemon usage statistics" OFF)
+# analogous to AC_USE_SYSTEM_EXTENSIONS in configure.ac
+add_definitions(-D_POSIX_C_SOURCE=199309L -D_GNU_SOURCE)
+
# do config checks
INCLUDE(ConfigureChecks.cmake)