You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/19 10:55:06 UTC

(nuttx-apps) branch master updated: libuv: Remove GCCVER redefinition

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 729cc337a libuv: Remove GCCVER redefinition
729cc337a is described below

commit 729cc337a1448a7f45a637cd3f31d355e7be79b2
Author: cuiziwei <cu...@xiaomi.com>
AuthorDate: Thu Oct 17 15:20:49 2024 +0800

    libuv: Remove GCCVER redefinition
    
    Signed-off-by: cuiziwei <cu...@xiaomi.com>
---
 system/libuv/CMakeLists.txt | 9 +--------
 system/libuv/Makefile       | 6 +-----
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/system/libuv/CMakeLists.txt b/system/libuv/CMakeLists.txt
index 55375ad2b..eefbd6488 100644
--- a/system/libuv/CMakeLists.txt
+++ b/system/libuv/CMakeLists.txt
@@ -44,13 +44,6 @@ 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
   # ############################################################################
@@ -60,7 +53,7 @@ if(CONFIG_LIBUV)
       -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE
       -DDEF_THREADPOOL_PRIORITY=CONFIG_LIBUV_THREADPOOL_PRIORITY)
 
-  if(GCCVER EQUAL 12)
+  if(GCCVER GREATER_EQUAL 12)
     list(APPEND CFLAGS -Wno-dangling-pointer)
   endif()
   # ############################################################################
diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index ee56f6666..1bc7e7fe2 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -54,11 +54,7 @@ CFLAGS += -DDEF_THREADPOOL_PRIORITY=CONFIG_LIBUV_THREADPOOL_PRIORITY
 CFLAGS += -DMAX_EPOLL_EVENTS=CONFIG_LIBUV_MAX_EPOLL_EVENTS
 CFLAGS += -DPREP_EVENT_SIZE=CONFIG_LIBUV_PREP_EVENT_SIZE
 
-ifeq ($(GCCVER),)
-  export GCCVER = $(shell $(CC) --version | grep gcc | sed -r 's/.* ([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
-endif
-
-ifeq ($(GCCVER),12)
+ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
   CFLAGS += -Wno-dangling-pointer
 endif