set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wcast-align")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wuninitialized")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshadow")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat=2")
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 5)
	set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types")
endif ()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
	set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-newline-eof")
	set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
endif()
