Merge pull request #3138 from ShadowsFriend/master
Fix OProfile discovery and drop bfd dependency
This commit is contained in:
commit
ba20f114eb
|
@ -512,13 +512,13 @@ if(NOT ANDROID)
|
|||
endif(PORTAUDIO)
|
||||
|
||||
if(OPROFILING)
|
||||
check_lib(OPROFILE "(no .pc for opagent)" opagent opagent.h)
|
||||
check_lib(BFD "(no .pc for bfd)" bfd bfd.h)
|
||||
if(OPROFILE_FOUND AND BFD_FOUND)
|
||||
message("oprofile found, enabling profiling support")
|
||||
include(FindOProfile)
|
||||
if(OPROFILE_FOUND)
|
||||
message("OProfile found, enabling profiling support")
|
||||
add_definitions(-DUSE_OPROFILE=1)
|
||||
include_directories(${OPROFILE_INCLUDE_DIRS})
|
||||
else()
|
||||
message(FATAL_ERROR "oprofile or bfd not found. Can't build profiling support.")
|
||||
message(FATAL_ERROR "OProfile not found. Can't build profiling support.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# - Try to find OProfile
|
||||
# Once done this will define
|
||||
# OPROFILE_FOUND - System has OProfile
|
||||
# OPROFILE_INCLUDE_DIRS - The OProfile include directories
|
||||
# OPROFILE_LIBRARIES - The libraries needed to use OProfile
|
||||
|
||||
find_path(OPROFILE_INCLUDE_DIR opagent.h)
|
||||
|
||||
find_library(OPROFILE_LIBRARY opagent
|
||||
PATH_SUFFIXES oprofile)
|
||||
|
||||
set(OPROFILE_INCLUDE_DIRS ${OPROFILE_INCLUDE_DIR})
|
||||
set(OPROFILE_LIBRARIES ${OPROFILE_LIBRARY})
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OProfile DEFAULT_MSG
|
||||
OPROFILE_LIBRARY OPROFILE_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(OPROFILE_INCLUDE_DIR OPROFILE_LIBRARY)
|
|
@ -265,7 +265,7 @@ if(PORTAUDIO_FOUND)
|
|||
endif(PORTAUDIO_FOUND)
|
||||
|
||||
if(OPROFILE_FOUND)
|
||||
set(LIBS ${LIBS} opagent bfd)
|
||||
set(LIBS ${LIBS} ${OPROFILE_LIBRARIES})
|
||||
endif(OPROFILE_FOUND)
|
||||
|
||||
if(GDBSTUB)
|
||||
|
|
Loading…
Reference in New Issue