cmake: factorize debug/dev define

This commit is contained in:
Gregory Hainaut 2016-02-21 16:17:10 +01:00
parent 8987ca61a1
commit a66c911fed
6 changed files with 10 additions and 90 deletions

View File

@ -272,9 +272,9 @@ else()
endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(DEBUG_FLAG "${DBG}")
set(DEBUG_FLAG "${DBG} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -D_DEBUG")
elseif(CMAKE_BUILD_TYPE MATCHES "Devel")
set(DEBUG_FLAG "${DBG} -DNDEBUG")
set(DEBUG_FLAG "${DBG} -DNDEBUG -DPCSX2_DEVBUILD -D_DEVEL")
elseif(CMAKE_BUILD_TYPE MATCHES "Release")
set(DEBUG_FLAG "-DNDEBUG")
endif()

View File

@ -8,39 +8,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED)
set(Output Utilities)
set(CommonFlags
set(CommonFlags
-fno-strict-aliasing
)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags} -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
set(UtilitiesFinalFlags
${UtilitiesFinalFlags}
${CommonFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
set(UtilitiesFinalFlags ${CommonFlags})
# variable with all sources of this library
set(UtilitiesSources

View File

@ -8,37 +8,11 @@ endif(NOT TOP_CMAKE_WAS_SOURCED)
set(Output x86emitter)
set(CommonFlags
set(CommonFlags
-fno-strict-aliasing
)
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
# add defines
set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} -DPCSX2_DEBUG -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel)
# add defines
set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags} -DPCSX2_DEVBUILD
)
endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release)
# add defines
set(x86emitterFinalFlags
${x86emitterFinalFlags}
${CommonFlags}
)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
set(x86emitterFinalFlags ${CommonFlags})
# variable with all sources of this library
set(x86emitterSources

View File

@ -30,23 +30,10 @@ else()
set(pcsx2FinalFlags "")
endif()
# Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(pcsx2FinalFlags ${pcsx2FinalFlags} ${CommonFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG)
elseif(CMAKE_BUILD_TYPE STREQUAL Devel)
set(pcsx2FinalFlags ${pcsx2FinalFlags} ${CommonFlags} -DPCSX2_DEVBUILD)
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
set(pcsx2FinalFlags ${pcsx2FinalFlags} ${CommonFlags})
endif()
set(pcsx2FinalFlags ${pcsx2FinalFlags} ${CommonFlags})
if(XDG_STD)
set(pcsx2FinalFlags
${pcsx2FinalFlags}
-DXDG_STD
)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DXDG_STD)
endif()
set(Output PCSX2)

View File

@ -17,16 +17,7 @@ set(CommonFlags
-Wunused-variable # __dummy variable need to be investigated
)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(GSdxFinalFlags ${GSdxFinalFlags} ${CommonFlags} -D_DEBUG)
elseif(CMAKE_BUILD_TYPE STREQUAL Devel)
set(GSdxFinalFlags ${GSdxFinalFlags} ${CommonFlags} -D_DEVEL)
elseif(CMAKE_BUILD_TYPE STREQUAL Release)
set(GSdxFinalFlags ${GSdxFinalFlags} ${CommonFlags} -W -Wno-unused-parameter)
endif()
set(GSdxFinalFlags ${CommonFlags})
if(XDG_STD)
set(GSdxFinalFlags ${GSdxFinalFlags} -DXDG_STD)

View File

@ -9,11 +9,7 @@ endif()
# plugin name
set(Output LilyPad-0.11.0)
if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(lilypadFinalFlags "-DPCSX2_DEBUG")
else()
set(lilypadFinalFlags "")
endif()
set(lilypadFinalFlags "")
# lilypad sources
set(lilypadSources