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()