From 1db5e0c0bf0a9be1d56e7372f361ead91e4c88c3 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 21 Feb 2016 16:22:31 +0100 Subject: [PATCH] cmake: create a prof build type It is the same as a release build but with the debug symbol and the frame pointer. --- build.sh | 4 +++- cmake/BuildParameters.cmake | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5c1e6a5220..2aacd4eff2 100755 --- a/build.sh +++ b/build.sh @@ -55,7 +55,8 @@ for ARG in "$@"; do --cppcheck ) cppcheck=1 ;; --dev|--devel ) flags+=(-DCMAKE_BUILD_TYPE=Devel) build="$root/build_dev";; --dbg|--debug ) flags+=(-DCMAKE_BUILD_TYPE=Debug) build="$root/build_dbg";; - --release ) flags+=(-DCMAKE_BUILD_TYPE=Release) build="$root/build_rel";; + --rel|--release ) flags+=(-DCMAKE_BUILD_TYPE=Release) build="$root/build_rel";; + --prof ) flags+=(-DCMAKE_BUILD_TYPE=Prof) build="$root/build_prof";; --strip ) flags+=(-DCMAKE_BUILD_STRIP=TRUE) ;; --glsl ) flags+=(-DGLSL_API=TRUE) ;; --egl ) flags+=(-DEGL_API=TRUE) ;; @@ -74,6 +75,7 @@ for ARG in "$@"; do echo "** User options **" echo "--dev / --devel : Build PCSX2 as a Development build." echo "--debug : Build PCSX2 as a Debug build." + echo "--prof : Build PCSX2 as a Profiler build (release + debug symbol)." echo "--release : Build PCSX2 as a Release build." echo echo "--clean : Do a clean build." diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 96746ab616..d091bd5384 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -277,6 +277,9 @@ elseif(CMAKE_BUILD_TYPE MATCHES "Devel") set(DEBUG_FLAG "${DBG} -DNDEBUG -DPCSX2_DEVBUILD -D_DEVEL") elseif(CMAKE_BUILD_TYPE MATCHES "Release") set(DEBUG_FLAG "-DNDEBUG") +elseif(CMAKE_BUILD_TYPE MATCHES "Prof") + # Keep frame pointer and debug information for profiler tool + set(DEBUG_FLAG "${DBG} -DNDEBUG") endif() if (USE_ASAN)