From 8c03d50421bebbe984f5c5e0afb72b9eeb7cae90 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 12 Jul 2014 16:04:57 +0200 Subject: [PATCH] cmake: remove a specific warning for clang --- cmake/BuildParameters.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 61256fcdba..54b340a4d4 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -49,6 +49,11 @@ if(PACKAGE_MODE) add_definitions(-DPLUGIN_DIR_COMPILATION=${PLUGIN_DIR} -DGAMEINDEX_DIR_COMPILATION=${GAMEINDEX_DIR}) endif(PACKAGE_MODE) +#------------------------------------------------------------------------------- +# Compiler extra +#------------------------------------------------------------------------------- +option(USE_CLANG "Use llvm/clang to build PCSX2 (developer option)") + #------------------------------------------------------------------------------- # Select the architecture #------------------------------------------------------------------------------- @@ -184,9 +189,15 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") # -Wno-missing-field-initializers: standard allow to init only the begin of struct/array in static init. Just a silly warning. # -Wno-unused-function: warn for function not used in release build # -Wno-unused-variable: just annoying to manage different level of logging, a couple of extra var won't kill any serious compiler. +# -Wno-deprecated-register: glib issue... set(DEFAULT_WARNINGS "-Wall -Wno-attributes -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable") +if (USE_CLANG) + set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-deprecated-register") +endif() + set(HARDENING_FLAG "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security") set(COMMON_FLAG "-pipe -std=c++0x -fvisibility=hidden -pthread") + if(CMAKE_BUILD_TYPE MATCHES "Debug|Devel") set(DEBUG_FLAG "-g") else()