Add _GNU_SOURCE=1 to find clone() with PGI
authorErik Lindahl <erik@kth.se>
Fri, 8 Aug 2014 20:36:48 +0000 (22:36 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 20 Aug 2014 16:38:10 +0000 (18:38 +0200)
The PGI C++ compiler would not find clone()
in sched.h unless _GNU_SOURCE is set, and
it shouldn't hurt any other platforms if
we add it by default for gmock.

Change-Id: Id9446622bb49e17efd80ea1508e0ee40b48acdbe

src/external/gmock-1.7.0/CMakeLists.txt

index 43e01ab288e5b6f797c87260bf683eba59a189bc..47a30b0358ed2652c7d49621f0596238f83e6301 100644 (file)
@@ -37,6 +37,7 @@
 
 include(gmxGetGmockTupleWorkaround)
 get_gmock_tuple_workaround(GMOCK_COMPILE_DEFINITIONS)
+set(GMOCK_COMPILE_DEFINITIONS "_GNU_SOURCE=1;${GMOCK_COMPILE_DEFINITIONS}")
 set(GMOCK_COMPILE_DEFINITIONS ${GMOCK_COMPILE_DEFINITIONS} PARENT_SCOPE)
 
 # GTest/GMock suggest linking with pthreads when available for thread safety