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