From 0ea6e677b6b46181a5c1b160d3ae067183c8acd5 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Tue, 10 Mar 2020 10:37:57 +0100 Subject: [PATCH] fix boost library order When statically compiling icinga2 with a local boost the order of the boost libraries matters. Correcting the order fixes the following linker issue: ``` make[5]: Entering directory `.../icinga2/icinga2-2.11.3/build' [ 98%] Linking CXX executable ../Bin/RELEASE/icinga2 .../boost_1_72_0/lib/libboost_coroutine.a(coroutine_context.o): In function `boost::coroutines::detail::coroutine_context::coroutine_context(void (*)(boost::context::detail::transfer_t), boost::coroutines::detail::preallocated const&)': coroutine_context.cpp:(.text+0x59): undefined reference to `make_fcontext' .../boost_1_72_0/lib/libboost_coroutine.a(coroutine_context.o): In function `boost::coroutines::detail::coroutine_context::jump(boost::coroutines::detail::coroutine_context&, void*)': coroutine_context.cpp:(.text+0xe8): undefined reference to `jump_fcontext' collect2: error: ld returned 1 exit status make[5]: *** [Bin/RELEASE/icinga2] Error 1 ``` Signed-off-by: Sven Nierlein --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1eefc9938..6db1ea214 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -161,7 +161,7 @@ else() set(LOGROTATE_CREATE "\n\tcreate 644 ${ICINGA2_USER} ${ICINGA2_GROUP}") endif() -find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS context coroutine date_time filesystem thread system program_options regex REQUIRED) +find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS coroutine context date_time filesystem thread system program_options regex REQUIRED) # Boost.Coroutine2 (the successor of Boost.Coroutine) # (1) doesn't even exist in old Boost versions and