Files
looking-glass-2/common/src/platform/linux/CMakeLists.txt
T
Quantum fc7dd7dbb7 [common] cmake: correctly link static libbfd.a
When linking against libbfd.so, just passing libbfd.so to the compiler is
sufficient. When linking against the static version libbfd.a, however,
we must additionally link against libiberty.a and libz.a.

This commit adds a CMake helper to find the correct libraries that need
to be passed to link against libbfd correctly.
2021-03-03 16:37:34 +11:00

28 lines
463 B
CMake

cmake_minimum_required(VERSION 3.0)
project(lg_common_platform_code LANGUAGES C)
include_directories(
${PROJECT_SOURCE_DIR}/include
${PROJECT_TOP}
)
add_library(lg_common_platform_code STATIC
crash.c
sysinfo.c
thread.c
event.c
ivshmem.c
time.c
)
if(ENABLE_BACKTRACE)
find_package(BFD)
target_link_libraries(lg_common_platform_code ${BFD_LIBRARIES})
endif()
target_link_libraries(lg_common_platform_code
lg_common
pthread
rt
)