#-----------------------------------------------------------------------
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
-macro(addflags args)
+macro(addflags_c args)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${args}")
+endmacro()
+macro(addflags_cxx args)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${args}")
endmacro()
+macro(addflags args)
+ addflags_c("${args}")
+ addflags_cxx("${args}")
+endmacro()
addflags("-fno-strict-aliasing")
if (NOT WIN32)
addflags("-fvisibility=hidden")
endif ()
+if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
+ addflags("-Werror")
+ addflags("-pedantic-errors")
+endif ()
+
+addflags("-Wall")
+addflags("-Wextra")
+addflags("-pedantic")
+
+addflags("-Wno-extra")
+addflags("-Wno-switch")
+addflags("-Wno-pedantic")
+addflags("-Wno-parentheses")
+addflags("-Wno-write-strings")
+addflags("-Wno-unused-function")
+addflags("-Wno-unused-variable")
+addflags("-Wno-unused-parameter")
+addflags("-Wno-deprecated-declarations")
+addflags("-Wno-unused-but-set-variable")
+addflags("-Wno-missing-field-initializers")
+
+addflags_c("-Wno-int-conversion")
+addflags_c("-Wno-pointer-to-int-cast")
+addflags_c("-Wno-incompatible-pointer-types")
+
+addflags_cxx("-Wno-reorder")
+addflags_cxx("-Wno-delete-non-virtual-dtor")
+
set(CMAKE_POSITION_INDEPENDENT_CODE 1)
set(GTK_TARGET 2 CACHE STRING "GTK target")
add_definitions(-DGTK_TARGET=${GTK_TARGET})