File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hconfig.h.in ${CMAKE_CURRENT_SOURCE_D
104104# see Makefile.in
105105set (CMAKE_C_STANDARD 99)
106106set (CMAKE_C_STANDARD_REQUIRED True )
107+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_C_COMPILER_ID STREQUAL "GNU" )
108+ set (CMAKE_C_EXTENSIONS ON )
109+ endif ()
107110set (CMAKE_CXX_STANDARD 11)
108111set (CMAKE_CXX_STANDARD_REQUIRED True )
109112
@@ -174,8 +177,6 @@ if(WITH_IO_URING)
174177 message (FATAL_ERROR "WITH_IO_URING is only supported on Linux because liburing is Linux-only." )
175178 endif ()
176179 set (LIBS ${LIBS} uring)
177- # liburing headers require GNU C extensions (typeof, statement expressions, etc.)
178- set_source_files_properties (event/io_uring.c PROPERTIES COMPILE_OPTIONS "-std=gnu99" )
179180endif ()
180181
181182if (WIN32 OR MINGW)
Original file line number Diff line number Diff line change 8787endif
8888
8989ifeq ($(findstring -std, $(CFLAGS ) ) , )
90+ ifeq ($(OS ) , Linux)
91+ override CFLAGS += -std=gnu99
92+ else
9093override CFLAGS += -std=c99
9194endif
95+ endif
9296
9397ifeq ($(findstring -std, $(CXXFLAGS ) ) , )
9498override CXXFLAGS += -std=c++11
@@ -199,13 +203,6 @@ ifeq ($(WITH_IO_URING), yes)
199203endif
200204endif
201205
202- # liburing headers require GNU C extensions (typeof, statement expressions, etc.)
203- ifeq ($(OS ) , Linux)
204- ifeq ($(WITH_IO_URING ) , yes)
205- event/io_uring.o : event/io_uring.c
206- $(CC ) $(CPPFLAGS ) $(CFLAGS ) -std=gnu99 -c $< -o $@
207- endif
208- endif
209206
210207LDFLAGS += $(addprefix -L, $(LIBDIRS ) )
211208LDFLAGS += $(addprefix -l, $(LIBS ) )
You can’t perform that action at this time.
0 commit comments