Skip to content

Commit

Permalink
cmake: add upstream patch 9650c09b952598e39b67962411900ef6303d4117
Browse files Browse the repository at this point in the history
From: Vadim Zhukov <[email protected]>
Subject: [PATCH] FindBacktrace: Search and report only when not already found

Avoid saying "... detected in default set..." each time CMake is run.

svn path=/trunk/; revision=1665
  • Loading branch information
DerDakon committed Dec 19, 2013
1 parent cb6e8c9 commit b74caf6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cmake/Modules/FindBacktrace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,20 @@ endif(Backtrace_HEADER)
find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}")
set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})

# First, check if we already have backtrace(), e.g., in libc
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
cmake_pop_check_state()
if (NOT DEFINED Backtrace_LIBRARY)
# First, check if we already have backtrace(), e.g., in libc
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS})
check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND)
cmake_pop_check_state()
endif()

if(_Backtrace_SYM_FOUND)
set(Backtrace_LIBRARY)
if(NOT Backtrace_FIND_QUIETLY)
# Avoid repeating the message() call below each time CMake is run.
if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY)
message(STATUS "backtrace facility detected in default set of libraries")
endif()
set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries")
else()
# Check for external library, for non-glibc systems
if(Backtrace_INCLUDE_DIR)
Expand Down

0 comments on commit b74caf6

Please sign in to comment.