mirror of https://github.com/PCSX2/pcsx2.git
cmake: sdl opt typo + clean warning management
Add back a lots of warning in the core!
This commit is contained in:
parent
23c76075e5
commit
f401f817ed
|
@ -34,7 +34,7 @@ option(XDG_STD "Use XDG standard path instead of the standard PCSX2 path")
|
|||
option(EXTRA_PLUGINS "Build various 'extra' plugins")
|
||||
# FIXME do a proper detection
|
||||
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(NOT DEFINED PLUGIN_DIR)
|
||||
|
@ -183,12 +183,17 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
|||
# -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-unused-function: warn for function not used in release build
|
||||
set(DEFAULT_WARNINGS "-Wno-attributes -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-function")
|
||||
set(HARDEING_OPT "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security")
|
||||
set(DEFAULT_GCC_FLAG "${ARCH_FLAG} -pthread ${DEFAULT_WARNINGS} ${HARDEING_OPT}")
|
||||
# -Wno-unused-variable: just annoying to manage different level of logging, a couple of extra var won't kill any serious compiler.
|
||||
set(DEFAULT_WARNINGS "-Wall -Wno-attributes -Wstrict-aliasing -Wno-missing-field-initializers -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable")
|
||||
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(DEFAULT_GCC_FLAG "-g ${DEFAULT_GCC_FLAG}")
|
||||
set(DEBUG_FLAG "-g")
|
||||
else()
|
||||
set(DEBUG_FLAG "")
|
||||
endif()
|
||||
|
||||
set(DEFAULT_GCC_FLAG "${ARCH_FLAG} ${COMMON_FLAG} ${DEFAULT_WARNINGS} ${HARDENING_FLAG} ${DEBUG_FLAG}")
|
||||
# c++ only flags
|
||||
set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof")
|
||||
|
||||
|
|
|
@ -11,19 +11,11 @@ set(Output Utilities)
|
|||
|
||||
# set common flags
|
||||
set(CommonFlags
|
||||
-pthread
|
||||
-fvisibility=hidden
|
||||
-fno-dse
|
||||
-fno-guess-branch-probability
|
||||
-fno-strict-aliasing
|
||||
-fno-tree-dse
|
||||
-pipe
|
||||
-Wunused-variable)
|
||||
|
||||
# set warning flags
|
||||
set(DebugFlags
|
||||
-g
|
||||
-W)
|
||||
)
|
||||
|
||||
# set optimization flags
|
||||
set(OptimizationFlags
|
||||
|
@ -70,7 +62,7 @@ set(OptimizationFlags
|
|||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
# add defines
|
||||
add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)
|
||||
add_definitions(${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
# Devel - Build
|
||||
|
|
|
@ -11,19 +11,11 @@ set(Output x86emitter)
|
|||
|
||||
# set common flags
|
||||
set(CommonFlags
|
||||
-pthread
|
||||
-fvisibility=hidden
|
||||
-fno-guess-branch-probability
|
||||
-fno-dse
|
||||
-fno-tree-dse
|
||||
-fno-strict-aliasing
|
||||
-pipe
|
||||
-Wunused-variable)
|
||||
|
||||
# set warning flags
|
||||
set(DebugFlags
|
||||
-W
|
||||
-g)
|
||||
)
|
||||
|
||||
# set optimization flags
|
||||
set(OptimizationFlags
|
||||
|
@ -70,7 +62,7 @@ set(OptimizationFlags
|
|||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
# add defines
|
||||
add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
|
||||
add_definitions(${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
|
||||
# Devel - Build
|
||||
|
|
|
@ -12,20 +12,14 @@ set(CommonFlags
|
|||
# Disable this optimization for the moment
|
||||
-fno-omit-frame-pointer
|
||||
# END GCC-4.6
|
||||
-pthread
|
||||
-fvisibility=hidden
|
||||
-fno-guess-branch-probability
|
||||
-fno-dse
|
||||
-fno-tree-dse
|
||||
-fno-strict-aliasing
|
||||
-Wno-parentheses
|
||||
-Wstrict-aliasing # Allow to track strict aliasing issue.
|
||||
-std=c++0x
|
||||
-pipe)
|
||||
|
||||
# set warning flags
|
||||
set(DebugFlags
|
||||
-W
|
||||
-g)
|
||||
-Wno-char-subscripts # only impact svu which is deprecated
|
||||
)
|
||||
|
||||
# set optimization flags
|
||||
set(OptimizationFlags
|
||||
|
@ -72,7 +66,7 @@ set(OptimizationFlags
|
|||
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
||||
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)
|
||||
|
||||
# Devel - Build
|
||||
|
|
|
@ -19,6 +19,7 @@ set(CommonFlags
|
|||
-fno-strict-aliasing
|
||||
-Wno-unknown-pragmas
|
||||
-Wno-parentheses
|
||||
-Wunused-variable # __dummy variable need to be investigated
|
||||
)
|
||||
|
||||
set(OptimizationFlags
|
||||
|
|
Loading…
Reference in New Issue