Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #107 from bdrewery/llvm-fix-libexecinfo-freebsd
Browse files Browse the repository at this point in the history
Merging r326358: Fix libexecinfo detection on FreeBSD and NetBSD.
  • Loading branch information
alexcrichton committed Feb 28, 2018
2 parents 5c6b7fe + 05b5e35 commit ba2edd7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Support/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ elseif( CMAKE_HOST_UNIX )
if( HAVE_LIBDL )
set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
endif()
if( HAVE_BACKTRACE )
set(system_libs ${system_libs} ${Backtrace_LIBRARIES})
if( HAVE_BACKTRACE AND NOT "${Backtrace_LIBRARIES}" STREQUAL "" )
# On BSDs, CMake returns a fully qualified path to the backtrace library.
# We need to remove the path and the 'lib' prefix, to make it look like a
# regular short library name, suitable for appending to a -l link flag.
get_filename_component(Backtrace_LIBFILE ${Backtrace_LIBRARIES} NAME_WE)
STRING(REGEX REPLACE "^lib" "" Backtrace_LIBFILE ${Backtrace_LIBFILE})
set(system_libs ${system_libs} ${Backtrace_LIBFILE})
endif()
if(LLVM_ENABLE_TERMINFO)
if(HAVE_TERMINFO)
Expand Down

0 comments on commit ba2edd7

Please sign in to comment.