Skip to content

Commit

Permalink
libuv: Remove GCCVER redefinition
Browse files Browse the repository at this point in the history
Signed-off-by: cuiziwei <[email protected]>
  • Loading branch information
cuiziweizw authored and xiaoxiang781216 committed Oct 19, 2024
1 parent e5a1bb1 commit 729cc33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
9 changes: 1 addition & 8 deletions system/libuv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ############################################################################
Expand All @@ -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()
# ############################################################################
Expand Down
6 changes: 1 addition & 5 deletions system/libuv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 729cc33

Please sign in to comment.