From 38691ffc67fad350e5d71dbe53d25514089b61cf Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Wed, 1 Feb 2012 13:20:47 -0800 Subject: [PATCH] Compile with _GNU_SOURCE when appropriate On non-Windows builds, we will now use _GNU_SOURCE so header files will include modern API extensions. This should resolve issue #547. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7858164f7..3a09605a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ IF (MSVC) SET(CMAKE_C_FLAGS_RELEASE "/MT /O2") SET(WIN_RC "src/win32/git2.rc") ELSE () - SET(CMAKE_C_FLAGS "-O2 -g -Wall -Wextra -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes ${CMAKE_C_FLAGS}") + SET(CMAKE_C_FLAGS "-O2 -g -D_GNU_SOURCE -Wall -Wextra -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes -Wmissing-prototypes ${CMAKE_C_FLAGS}") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF (NOT MINGW) # MinGW always does PIC and complains if we tell it to SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")