This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 13ce4707f libuv: Remove GCCVER and add compilation options directly.
13ce4707f is described below

commit 13ce4707ffbf4bfb28b7a81b29c7adfeb917042b
Author: cuiziwei <[email protected]>
AuthorDate: Fri Oct 11 15:12:08 2024 +0800

    libuv: Remove GCCVER and add compilation options directly.
    
    Signed-off-by: cuiziwei <[email protected]>
---
 system/libuv/CMakeLists.txt | 16 ++++------------
 system/libuv/Makefile       |  9 +--------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/system/libuv/CMakeLists.txt b/system/libuv/CMakeLists.txt
index 205eeae7c..60a389cc2 100644
--- a/system/libuv/CMakeLists.txt
+++ b/system/libuv/CMakeLists.txt
@@ -44,23 +44,15 @@ if(CONFIG_LIBUV)
     endif()
   endif()
 
-  if(NOT DEFINED GCCVER)
-    execute_process(COMMAND ${CMAKE_C_COMPILER} --version
-                    OUTPUT_VARIABLE GCC_VERSION_OUTPUT)
-    string(REGEX MATCH "\\+\\+.* ([0-9]+)\\.[0-9]+" GCC_VERSION_REGEX
-                 "${GCC_VERSION_OUTPUT}")
-    set(GCCVER ${CMAKE_MATCH_1})
-  endif()
   # 
############################################################################
   # Flags
   # 
############################################################################
 
-  set(CFLAGS -Wno-shadow -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
-             -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE)
+  set(CFLAGS
+      -Wno-shadow -Wno-dangling-pointer
+      -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
+      -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE)
 
-  if(GCCVER EQUAL 12)
-    list(APPEND CFLAGS -Wno-dangling-pointer)
-  endif()
   # 
############################################################################
   # Sources
   # 
############################################################################
diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index bb2b50bcc..d0adbc4d9 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -49,17 +49,10 @@ CFLAGS += -I$(LIBUV_UNPACK)/src
 CFLAGS += -I$(LIBUV_UNPACK)/src/unix
 CFLAGS += -I$(LIBUV_UNPACK)/test
 CFLAGS += -Wno-shadow
+CFLAGS += -Wno-dangling-pointer
 CFLAGS += -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
 CFLAGS += -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE
 
-ifeq ($(GCCVER),)
-  export GCCVER = $(shell $(CC) --version | grep gcc | sed -r 's/.* 
([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
-endif
-
-ifeq ($(GCCVER),12)
-  CFLAGS += -Wno-dangling-pointer
-endif
-
 VPATH += $(LIBUV_UNPACK)/src
 VPATH += $(LIBUV_UNPACK)/src/unix
 VPATH += $(LIBUV_UNPACK)/test

Reply via email to