From 60a0cbb30633d7dc89cd3801e5bcc7a64e7325a2 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Thu, 9 Apr 2015 17:21:02 +0300 Subject: [PATCH] Added profiling option to CMake. Adding the -DPROFILE=Y to the CMake command now compiles executables with the -pg flag. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fa7039e5..a8fb91fb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,9 @@ if(FAKE_CODE) set(FLAGS "${FLAGS} -DFAKE_CODE" CACHE STRING "Compilation flags") endif() +if(PROFILE) + set(FLAGS "${FLAGS} -pg " CACHE STRING "Compilation flags") +endif() set(CMAKE_C_FLAGS "${FLAGS}") set(CMAKE_C_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG")