From 156f1b70c30e0720b8f37a77f71c03715e85cf96 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Tue, 17 May 2016 19:31:39 +0200 Subject: [PATCH] cmake: disable avx2+ on debug build Gdb (7.7.1) doesn't support it properly. --- cmake/BuildParameters.cmake | 53 ++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 15ac3b24c6..36513febee 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -117,6 +117,34 @@ if(BUILTIN_CDVD) set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_CDVD_PLUGIN") endif() +#------------------------------------------------------------------------------- +# if no build type is set, use Devel as default +# Note without the CMAKE_BUILD_TYPE options the value is still defined to "" +# Ensure that the value set by the User is correct to avoid some bad behavior later +#------------------------------------------------------------------------------- +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release|Prof") + set(CMAKE_BUILD_TYPE Devel) + message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default") +endif() +# AVX2 doesn't play well with gdb +if(CMAKE_BUILD_TYPE MATCHES "Debug") + SET(DISABLE_ADVANCE_SIMD ON) +endif() + +# Initially strip was disabled on release build but it is not stackstrace friendly! +# It only cost several MB so disbable it by default +option(CMAKE_BUILD_STRIP "Srip binaries to save a couple of MB (developer option)") + +if(NOT DEFINED CMAKE_BUILD_PO) + if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(CMAKE_BUILD_PO TRUE) + message(STATUS "Enable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!") + else() + set(CMAKE_BUILD_PO FALSE) + message(STATUS "Disable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!") + endif() +endif() + #------------------------------------------------------------------------------- # Select the architecture #------------------------------------------------------------------------------- @@ -203,31 +231,6 @@ else() message(FATAL_ERROR "Unsupported architecture: ${PCSX2_TARGET_ARCHITECTURES}") endif() -#------------------------------------------------------------------------------- -# if no build type is set, use Devel as default -# Note without the CMAKE_BUILD_TYPE options the value is still defined to "" -# Ensure that the value set by the User is correct to avoid some bad behavior later -#------------------------------------------------------------------------------- -if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release|Prof") - set(CMAKE_BUILD_TYPE Devel) - message(STATUS "BuildType set to ${CMAKE_BUILD_TYPE} by default") -endif() - -# Initially strip was disabled on release build but it is not stackstrace friendly! -# It only cost several MB so disbable it by default -option(CMAKE_BUILD_STRIP "Srip binaries to save a couple of MB (developer option)") - -if(NOT DEFINED CMAKE_BUILD_PO) - if(CMAKE_BUILD_TYPE STREQUAL "Release") - set(CMAKE_BUILD_PO TRUE) - message(STATUS "Enable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!") - else() - set(CMAKE_BUILD_PO FALSE) - message(STATUS "Disable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!") - endif() -endif() - - #------------------------------------------------------------------------------- # Control GCC flags #-------------------------------------------------------------------------------