From 82d7fd56a60ba7ca1172fd66456451bb75bddee8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 28 Jan 2015 14:26:06 -0800 Subject: Added Profile build type, 'make prof' target. --- CMakeLists.txt | 2 +- Makefile | 6 ++++++ src/CMakeLists.txt | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00c5d8f..f681698 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,5 +20,5 @@ add_subdirectory(test testdir) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: Debug Release." FORCE) + "Choose the type of build, options are: Debug Profile Release." FORCE) endif(NOT CMAKE_BUILD_TYPE) diff --git a/Makefile b/Makefile index 90990b1..df99367 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,12 @@ debug: cmake .. -DCMAKE_BUILD_TYPE=Debug; \ make +prof: + mkdir -p $(BUILDDIR); \ + cd $(BUILDDIR); \ + cmake .. -DCMAKE_BUILD_TYPE=Profile; \ + make + mingw: mkdir -p $(MINGW_BUILDDIR); \ cd $(MINGW_BUILDDIR); \ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 033a9be..044b7e4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -68,6 +68,9 @@ set_target_properties(${PROGRAM} PROPERTIES set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -pg -DCMARK_DEBUG_NODES") set(CMAKE_LINKER_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -pg") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE} -pg") +set(CMAKE_LINKER_PROFILE "${CMAKE_LINKER_FLAGS_RELEASE} -pg") + if (${CMAKE_MAJOR_VERSION} GREATER 1 AND ${CMAKE_MINOR_VERSION} GREATER 8) set(CMAKE_C_VISIBILITY_PRESET hidden) set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) -- cgit v1.2.3