From e3b28a2065923073db4d1ed2687a3c91eb01dde0 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 29 Jul 2011 04:54:16 -0700 Subject: [PATCH] Enable some compiler warning flags --- CMakeLists.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index be1e354981b..be868258213 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 2.6) SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +include(CheckCCompilerFlag) + project(DSOAL C) set(LIBNAME dsound) @@ -26,6 +28,17 @@ include_directories("${DSOAL_BINARY_DIR}" ${OPENAL_INCLUDE_DIR}) if(WIN32) add_definitions(-D_WIN32 -DDEBUG_INFO) + if(NOT MSVC) + add_definitions(-Winline -Wall) + check_c_compiler_flag(-Wextra HAVE_W_EXTRA) + if(HAVE_W_EXTRA) + add_definitions(-Wextra) + endif() + check_c_compiler_flag(-Wformat=0 HAVE_W_FORMAT_ZERO) + if(HAVE_W_FORMAT_ZERO) + add_definitions(-Wformat=0) + endif() + endif() set(DSOAL_OBJS ${DSOAL_OBJS} debug.c) -- 2.11.4.GIT