]> granicus.if.org Git - esp-idf/commitdiff
build: Add a standard way to use GNU extensions from libc, since we have a general...
authorAnton Maklakov <anton@espressif.com>
Mon, 15 Apr 2019 04:34:43 +0000 (11:34 +0700)
committerAnton Maklakov <anton@espressif.com>
Wed, 17 Apr 2019 05:08:36 +0000 (12:08 +0700)
make/project.mk
tools/cmake/idf_functions.cmake

index 17f07c2cd9339011b02e2dc4b694d7d32db34c71..034ad2a15ee85f2b5206ff6509b60e9af0ed1c2c 100644 (file)
@@ -427,6 +427,9 @@ ifdef CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED
 CPPFLAGS += -DNDEBUG
 endif
 
+# IDF uses some GNU extension from libc
+CPPFLAGS += -D_GNU_SOURCE
+
 # Enable generation of debugging symbols
 # (we generate even in Release mode, as this has no impact on final binary size.)
 DEBUG_FLAGS ?= -ggdb
index 104144ac13aec4b0c93b12cd4cd82b50528e4eda..d5b7fff1acae6dbd88553086dd49fe6bd6745aa5 100644 (file)
@@ -107,6 +107,9 @@ function(idf_set_global_compile_options)
     list(APPEND c_compile_options "-std=gnu99")
     list(APPEND cxx_compile_options "-std=gnu++11" "-fno-rtti")
 
+    # IDF uses some GNU extension from libc
+    list(APPEND compile_definitions "_GNU_SOURCE")
+
     if(CONFIG_CXX_EXCEPTIONS)
         list(APPEND cxx_compile_options "-fexceptions")
     else()