From 9e80caa85dbff13f4f3a3ff12e5fe3c64bae8f0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Myyr=C3=A4?= Date: Tue, 1 Jan 2019 11:12:33 +0200 Subject: [PATCH] fix Unix builds without backtrace functions in their libc backtrace functions are not present in all libc implementations. Cmake has module to add external libraries into build if needed so use it to fix build on Unix systems without backtrace in libc. --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 450c14b1e..73d64cf7e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1303,6 +1303,13 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") set( ZDOOM_LIBS ${ZDOOM_LIBS} nsl socket) endif() +if( UNIX ) + find_package( Backtrace ) + if(Backtrace_FOUND) + set( ZDOOM_LIBS ${ZDOOM_LIBS} ${Backtrace_LIBRARIES} ) + endif() +endif() + target_link_libraries( zdoom ${ZDOOM_LIBS} gdtoa dumb lzma ) include_directories( .