From: Timo Lotterbach Date: Thu, 10 May 2012 12:37:50 +0000 (+0200) Subject: LayerManagement: enabled "profiling" build setting for GCC X-Git-Tag: ivi-layer-management_version_0_9_7_rc~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9afd13808aba75a54398a8533a00e0d852e8d179;p=profile%2Fivi%2Flayer-management.git LayerManagement: enabled "profiling" build setting for GCC If LayerManagement is build on a GCC-based platform, an additional build setting named 'profiling' is available. Building with this setting results in intrumented versions. The result can be used with gprof-based tools. --- diff --git a/cmake/optionalFeatures/CMakeLists.txt b/cmake/optionalFeatures/CMakeLists.txt index 9863c5e..ab4a012 100644 --- a/cmake/optionalFeatures/CMakeLists.txt +++ b/cmake/optionalFeatures/CMakeLists.txt @@ -21,3 +21,4 @@ cmake_minimum_required (VERSION 2.6) add_subdirectory(codeCoverage) +add_subdirectory(profiling) diff --git a/cmake/optionalFeatures/profiling/CMakeLists.txt b/cmake/optionalFeatures/profiling/CMakeLists.txt new file mode 100644 index 0000000..a80de89 --- /dev/null +++ b/cmake/optionalFeatures/profiling/CMakeLists.txt @@ -0,0 +1,41 @@ +############################################################################ +# +# Copyright 2010, 2011 BMW Car IT GmbH +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +cmake_minimum_required (VERSION 2.6) + +# this file adds a new build-setting 'profiling', +# if all required tools are found + +if(CMAKE_COMPILER_IS_GNUCC) + message(STATUS "GCC detected, enabled 'profiling' build configuration") + + SET(GCC_PROFILING_FLAGS "-g -pg") + + # compiler + + SET(CMAKE_CXX_FLAGS_PROFILING "${GCC_PROFILING_FLAGS}" CACHE STRING "" FORCE) + SET(CMAKE_C_FLAGS_PROFILING "${GCC_PROFILING_FLAGS}" CACHE STRING "" FORCE) + + # linker + + SET(CMAKE_EXE_LINKER_FLAGS_PROFILING "${GCC_PROFILING_FLAGS}" CACHE STRING "" FORCE) + SET(CMAKE_MODULE_LINKER_FLAGS_PROFILING "${GCC_PROFILING_FLAGS}" CACHE STRING "" FORCE) + SET(CMAKE_SHARED_LINKER_FLAGS_PROFILING "${GCC_PROFILING_FLAGS}" CACHE STRING "" FORCE) + +endif(CMAKE_COMPILER_IS_GNUCC)