+ -Wwrite-strings)
+
+ include(CheckCCompilerFlag)
+ CHECK_C_COMPILER_FLAG(-fstack-protector-strong COMPILER_SUPPORTS_STACK_PROTECTOR_STRONG)
+ if (COMPILER_SUPPORTS_STACK_PROTECTOR_STRONG)
+ add_flags(CMAKE_C_FLAGS -fstack-protector-strong)
+ else()
+ add_flags(CMAKE_C_FLAGS -fstack-protector)
+ endif()
+
+ add_flags(DEBUG_FLAGS
+ -ggdb)
+
+ add_flags(RELEASE_FLAGS
+ -Wp,-D_FORTIFY_SOURCE=2)
+
+ if (STRICT_COMPILATION_CHECKS)
+ add_flags(STRICT_FLAGS
+ -Werror
+ # sign conversion warnings can be very noisy for a very little gain
+ #-Wsign-conversion
+ # NOTE: Vanilla libusb-1.0.8 can't live with -pedantic-errors
+ -pedantic-errors)
+
+ endif()
+endif()
+
+if (CMAKE_COMPILER_IS_GNUCC)
+ add_flags(CMAKE_C_FLAGS