From aac34f037ff4b37085b920fb1b39a9b584239af6 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Sat, 8 Jan 2011 05:27:18 +0000 Subject: [PATCH] Add profiling (via oprofile) to the cmake build. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6782 8ced0084-cf51-0410-be5f-012b33b47a6e --- CMakeLists.txt | 11 +++++++++++ Source/Core/Core/CMakeLists.txt | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f8ff113a9d..78144eb4ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,17 @@ else() set(PORTAUDIO_FOUND FALSE) endif(PORTAUDIO) +option(OPROFILING "Enable profiling" OFF) +if(OPROFILING) + check_lib(OPROFILE opagent opagent.h) + check_lib(BFD bfd bfd.h) + if(OPROFILE_FOUND AND BFD_FOUND) + message("oprofile found, enabling profiling support") + add_definitions(-DUSE_OPROFILE=1) + else() + message(FATAL_ERROR "oprofile or bfd not found. Can't build profiling support.") + endif() +endif() ######################################## # Setup include directories (and make sure they are preferred over the Externals) diff --git a/Source/Core/Core/CMakeLists.txt b/Source/Core/Core/CMakeLists.txt index 6fe518cb83..0909c669b8 100644 --- a/Source/Core/Core/CMakeLists.txt +++ b/Source/Core/Core/CMakeLists.txt @@ -153,6 +153,10 @@ if(PORTAUDIO_FOUND) set(LIBS ${LIBS} portaudio) endif(PORTAUDIO_FOUND) +if(OPROFILE_FOUND) + set(LIBS ${LIBS} opagent bfd) +endif(OPROFILE_FOUND) + add_library(core STATIC ${SRCS}) target_link_libraries(core ${LIBS})