Skip to content

Commit 729cc33

Browse files
cuiziweizwxiaoxiang781216
authored andcommitted
libuv: Remove GCCVER redefinition
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
1 parent e5a1bb1 commit 729cc33

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

system/libuv/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ if(CONFIG_LIBUV)
4444
endif()
4545
endif()
4646

47-
if(NOT DEFINED GCCVER)
48-
execute_process(COMMAND ${CMAKE_C_COMPILER} --version
49-
OUTPUT_VARIABLE GCC_VERSION_OUTPUT)
50-
string(REGEX MATCH "\\+\\+.* ([0-9]+)\\.[0-9]+" GCC_VERSION_REGEX
51-
"${GCC_VERSION_OUTPUT}")
52-
set(GCCVER ${CMAKE_MATCH_1})
53-
endif()
5447
# ############################################################################
5548
# Flags
5649
# ############################################################################
@@ -60,7 +53,7 @@ if(CONFIG_LIBUV)
6053
-DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE
6154
-DDEF_THREADPOOL_PRIORITY=CONFIG_LIBUV_THREADPOOL_PRIORITY)
6255

63-
if(GCCVER EQUAL 12)
56+
if(GCCVER GREATER_EQUAL 12)
6457
list(APPEND CFLAGS -Wno-dangling-pointer)
6558
endif()
6659
# ############################################################################

system/libuv/Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ CFLAGS += -DDEF_THREADPOOL_PRIORITY=CONFIG_LIBUV_THREADPOOL_PRIORITY
5454
CFLAGS += -DMAX_EPOLL_EVENTS=CONFIG_LIBUV_MAX_EPOLL_EVENTS
5555
CFLAGS += -DPREP_EVENT_SIZE=CONFIG_LIBUV_PREP_EVENT_SIZE
5656

57-
ifeq ($(GCCVER),)
58-
export GCCVER = $(shell $(CC) --version | grep gcc | sed -r 's/.* ([0-9]+\.[0-9]+).*/\1/' | cut -d'.' -f1)
59-
endif
60-
61-
ifeq ($(GCCVER),12)
57+
ifeq ($(shell expr "$(GCCVER)" \>= 12), 1)
6258
CFLAGS += -Wno-dangling-pointer
6359
endif
6460

0 commit comments

Comments
 (0)