check_c_compiler_flag(-Wimplicit-fallthrough HAS_IMPLICIT_FALLTHROUGH)
ENDIF()
-ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-unknown-warning-option -Wno-format-truncation)
+ADD_DEFINITIONS(-Wall -Werror)
+IF(CMAKE_C_COMPILER_VERSION VERSION_GREATER 6)
+ add_definitions(-Wextra -Werror=implicit-function-declaration)
+ add_definitions(-Wformat -Werror=format-security -Werror=format-nonliteral)
+ENDIF()
+ADD_DEFINITIONS(-Os --std=gnu99 -Wmissing-declarations -Wno-unused-parameter -Wno-unused-but-set-parameter)
IF(HAS_IMPLICIT_FALLTHROUGH)
ADD_DEFINITIONS(-Wimplicit-fallthrough)
ENDIF()
ENDIF()
+ADD_CUSTOM_COMMAND(
+ OUTPUT ethtool-modes.h
+ COMMAND ./make_ethtool_modes_h.sh ${CMAKE_C_COMPILER} > ./ethtool-modes.h
+ DEPENDS ./make_ethtool_modes_h.sh
+)
+ADD_CUSTOM_TARGET(ethtool-modes-h DEPENDS ethtool-modes.h)
+
IF("${CMAKE_SYSTEM_NAME}" MATCHES "Linux" AND NOT DUMMY_MODE)
SET(SOURCES ${SOURCES} system-linux.c)
SET(LIBS ${LIBS} ${LIBNL_LIBS})
INSTALL(TARGETS netifd
RUNTIME DESTINATION sbin
)
+ADD_DEPENDENCIES(netifd ethtool-modes-h)