[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.
This commit is contained in:
Quantum
2021-02-28 19:51:54 -05:00
committed by Geoffrey McRae
parent b00c25a822
commit fc7dd7dbb7
4 changed files with 45 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
project(looking-glass-client C)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
include(GNUInstallDirs)
include(CheckCCompilerFlag)