From 6562cb61df02e2b9f57f803752dfaade44d2e1ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 3 Feb 2019 20:09:02 +0100 Subject: [PATCH] cmake: don't try to link againt xcb-errors when we didn't find it --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index edadd6b..5e80df8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,10 +48,11 @@ endif () if (ENABLE_X11) add_library(xcb-stuff STATIC EXCLUDE_FROM_ALL xcb.c xcb.h) + target_link_libraries(xcb-stuff PkgConfig::xcb) if (XCB_ERRORS_FOUND) target_compile_definitions(xcb-stuff PRIVATE HAVE_XCB_ERRORS) + target_link_libraries(xcb-stuff PkgConfig::xcb-errors) endif () - target_link_libraries(xcb-stuff PkgConfig::xcb PkgConfig::xcb-errors) add_library(bar-xcb STATIC EXCLUDE_FROM_ALL bar/xcb.c bar/xcb.h) target_link_libraries(bar-xcb