libstrawberry-common: check for library/includes for backtrace() (#364)

This is a non-standard header, so it should be checked properly.
This fixes compilation with musl libc and possibly other C library
implementations.
This commit is contained in:
Daniel Kolesa
2020-02-06 20:04:23 +01:00
committed by GitHub
parent 4bd4d3ae03
commit 814bb3006c
4 changed files with 39 additions and 4 deletions

View File

@@ -1,8 +1,14 @@
if (Backtrace_FOUND)
include_directories(${Backtrace_INCLUDE_DIRS})
endif (Backtrace_FOUND)
include_directories(${PROTOBUF_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/backtrace_inc.h.in ${CMAKE_CURRENT_BINARY_DIR}/backtrace_inc.h)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -U__STRICT_ANSI__ -Wall -Wextra -Wpedantic -Woverloaded-virtual -fpermissive")
@@ -38,6 +44,10 @@ add_library(libstrawberry-common STATIC
${MOC}
)
if (Backtrace_FOUND)
target_link_libraries(libstrawberry-common ${Backtrace_LIBRARIES})
endif (Backtrace_FOUND)
target_link_libraries(libstrawberry-common
#${PROTOBUF_LIBRARY}
${TAGLIB_LIBRARIES}