cmake: sdl opt typo + clean warning management

Add back a lots of warning in the core!
This commit is contained in:
Gregory Hainaut 2014-07-11 23:33:09 +02:00
parent 23c76075e5
commit f401f817ed
5 changed files with 19 additions and 35 deletions

View File

@ -34,7 +34,7 @@ option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
option(EXTRA_PLUGINS "Build various 'extra' plugins") option(EXTRA_PLUGINS "Build various 'extra' plugins")
# FIXME do a proper detection # FIXME do a proper detection
set(SDL2_LIBRARY "-lSDL2") set(SDL2_LIBRARY "-lSDL2")
option(SDL2_LIBRARY "Use SDL2 on spu2x and onepad") option(SDL2_API "Use SDL2 on spu2x and onepad")
if(PACKAGE_MODE) if(PACKAGE_MODE)
if(NOT DEFINED PLUGIN_DIR) if(NOT DEFINED PLUGIN_DIR)
@ -183,12 +183,17 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
# -Wstrict-aliasing: to fix one day aliasing issue # -Wstrict-aliasing: to fix one day aliasing issue
# -Wno-missing-field-initializers: standard allow to init only the begin of struct/array in static init. Just a silly warning. # -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-function: warn for function not used in release build
set(DEFAULT_WARNINGS "-Wno-attributes -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-function") # -Wno-unused-variable: just annoying to manage different level of logging, a couple of extra var won't kill any serious compiler.
set(HARDEING_OPT "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security") set(DEFAULT_WARNINGS "-Wall -Wno-attributes -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable")
set(DEFAULT_GCC_FLAG "${ARCH_FLAG} -pthread ${DEFAULT_WARNINGS} ${HARDEING_OPT}") 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") if(CMAKE_BUILD_TYPE MATCHES "Debug|Devel")
set(DEFAULT_GCC_FLAG "-g ${DEFAULT_GCC_FLAG}") set(DEBUG_FLAG "-g")
else()
set(DEBUG_FLAG "")
endif() endif()
set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${HARDENING_FLAG} ${DEBUG_FLAG}")
# c++ only flags # c++ only flags
set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof") set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof")

View File

@ -11,19 +11,11 @@ set(Output Utilities)
# set common flags # set common flags
set(CommonFlags set(CommonFlags
-pthread
-fvisibility=hidden
-fno-dse -fno-dse
-fno-guess-branch-probability -fno-guess-branch-probability
-fno-strict-aliasing -fno-strict-aliasing
-fno-tree-dse -fno-tree-dse
-pipe )
-Wunused-variable)
# set warning flags
set(DebugFlags
-g
-W)
# set optimization flags # set optimization flags
set(OptimizationFlags set(OptimizationFlags
@ -70,7 +62,7 @@ set(OptimizationFlags
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD) add_definitions(${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build

View File

@ -11,19 +11,11 @@ set(Output x86emitter)
# set common flags # set common flags
set(CommonFlags set(CommonFlags
-pthread
-fvisibility=hidden
-fno-guess-branch-probability -fno-guess-branch-probability
-fno-dse -fno-dse
-fno-tree-dse -fno-tree-dse
-fno-strict-aliasing -fno-strict-aliasing
-pipe )
-Wunused-variable)
# set warning flags
set(DebugFlags
-W
-g)
# set optimization flags # set optimization flags
set(OptimizationFlags set(OptimizationFlags
@ -70,7 +62,7 @@ set(OptimizationFlags
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines # add defines
add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG) add_definitions(${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build

View File

@ -12,20 +12,14 @@ set(CommonFlags
# Disable this optimization for the moment # Disable this optimization for the moment
-fno-omit-frame-pointer -fno-omit-frame-pointer
# END GCC-4.6 # END GCC-4.6
-pthread
-fvisibility=hidden
-fno-guess-branch-probability -fno-guess-branch-probability
-fno-dse -fno-dse
-fno-tree-dse -fno-tree-dse
-fno-strict-aliasing -fno-strict-aliasing
-Wno-parentheses
-Wstrict-aliasing # Allow to track strict aliasing issue. -Wstrict-aliasing # Allow to track strict aliasing issue.
-std=c++0x -Wno-char-subscripts # only impact svu which is deprecated
-pipe) )
# set warning flags
set(DebugFlags
-W
-g)
# set optimization flags # set optimization flags
set(OptimizationFlags set(OptimizationFlags
@ -72,7 +66,7 @@ set(OptimizationFlags
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(Output pcsx2-dbg) set(Output pcsx2-dbg)
add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP) add_definitions(${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build

View File

@ -19,6 +19,7 @@ set(CommonFlags
-fno-strict-aliasing -fno-strict-aliasing
-Wno-unknown-pragmas -Wno-unknown-pragmas
-Wno-parentheses -Wno-parentheses
-Wunused-variable # __dummy variable need to be investigated
) )
set(OptimizationFlags set(OptimizationFlags