From 8886c03883096a43964a9c022eb709c6748362b5 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Sat, 14 Jan 2017 00:27:19 +0100 Subject: [PATCH] Set c/cxx flags to -Wall -pedantic Special case for freetype2: -Wno-extended-offsetof, to prevent some 140 warnings. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dd37dc..604fb24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,6 +381,9 @@ IF(CMAKE_COMPILER_IS_GNUCC) ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") ENDIF(CMAKE_COMPILER_IS_GNUCC) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall -pedantic") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -pedantic") + CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) IF(HAVE_STRCASECMP) ADD_DEFINITIONS(-DHAVE_STRCASECMP) @@ -654,7 +657,7 @@ ELSE(MSVC) ENDIF(COMPILER_HAS_NOSTRICTALIAS) SET_SOURCE_FILES_PROPERTIES( ${FREETYPE2_SRCS} - PROPERTIES COMPILE_FLAGS "-DFT_CONFIG_OPTION_SYSTEM_ZLIB -DFT_CONFIG_CONFIG_H='\"${FREETYPE2DIR}/include/freetype/config/ftconfig.h\"' -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H='\"${FREETYPE2DIR}/include/freetype/config/ftmodule.h\"' -I${FREETYPE2SRCDIR} -I${FREETYPE2DIR}/include/freetype/config -DHAVE_FCNTL_H ${NOSTRICTALIAS}" + PROPERTIES COMPILE_FLAGS "-Wno-extended-offsetof -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DFT_CONFIG_CONFIG_H='\"${FREETYPE2DIR}/include/freetype/config/ftconfig.h\"' -DFT2_BUILD_LIBRARY -DFT_CONFIG_MODULES_H='\"${FREETYPE2DIR}/include/freetype/config/ftmodule.h\"' -I${FREETYPE2SRCDIR} -I${FREETYPE2DIR}/include/freetype/config -DHAVE_FCNTL_H ${NOSTRICTALIAS}" ) ENDIF(MSVC)