Attempt to fix compilation on BSD

This commit is contained in:
o9000 2016-01-03 03:20:41 +01:00
parent 0a035c9c3b
commit da0369492e

View file

@ -32,10 +32,13 @@ if(BACKTRACE_LIBC)
else()
pkg_check_modules( UNWIND libunwind )
find_library(EXECINFO_LIBRARIES NAMES execinfo)
if(EXECINFO_LIBRARIES)
if(EXECINFO_LIBRARIES_FOUND)
set(EXECINFO_FOUND TRUE)
set(EXECINFO_LIBRARIES "-lexecinfo")
set(BACKTRACE_L_FLAGS "-rdynamic")
else()
set(EXECINFO_LIBRARIES "")
set(BACKTRACE_L_FLAGS "")
endif()
endif()
@ -61,7 +64,7 @@ if( NOT IMLIB_BUILD_WITH_X )
endif( NOT IMLIB_BUILD_WITH_X )
if( NOT BACKTRACE_LIBC_FOUND AND NOT UNWIND_FOUND AND NOT EXECINFO_FOUND )
message( WARNING "Backtrace support not available. You can enable it with libexecinfo/libunwind or libc." )
message( WARNING "Backtrace support not available. You can enable it by installing libexecinfo or libunwind." )
endif()
add_definitions( -D_GNU_SOURCE )