Skip to content

Commit

Permalink
fix: include getcontext source only if it is not available in target
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixaill committed Jun 5, 2020
1 parent 0acb3ff commit d10734c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ set(BREAKPAD_SOURCES_COMMON_LINUX
breakpad/src/common/linux/linux_libc_support.cc
breakpad/src/common/linux/memory_mapped_file.cc
breakpad/src/common/linux/safe_readlink.cc
)

set(BREAKPAD_SOURCES_COMMON_LINUX_GETCONTEXT
breakpad/src/common/linux/breakpad_getcontext.S
)

Expand Down Expand Up @@ -71,6 +74,15 @@ target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON})

if(LINUX OR ANDROID)
target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON_LINUX} ${BREAKPAD_SOURCES_CLIENT_LINUX})

include(CheckFunctionExists)
check_function_exists(getcontext HAVE_GETCONTEXT)
if(HAVE_GETCONTEXT)
target_compile_definitions(breakpad_client PRIVATE HAVE_GETCONTEXT)
else()
target_sources(breakpad_client PRIVATE ${BREAKPAD_SOURCES_COMMON_LINUX_GETCONTEXT})
endif()

set_property(TARGET breakpad_client PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()

Expand Down

0 comments on commit d10734c

Please sign in to comment.