From 1a00949b19eaecb84af0f27c370400dc71a9fd84 Mon Sep 17 00:00:00 2001 From: Aaron Rossetto Date: Fri, 1 May 2020 14:52:42 -0500 Subject: Revert "host: cmake: add boost unit_test_framework required iff ENABLE_TESTS=ON" This reverts commit 93acdfe3808ba8aca6c04cbf2474d6e8db39a0ee. The commit introduced an issue when building without specifying ENABLE_TESTS explicitly to CMake. Normally, if the user doesn't set ENABLE_TESTS, it gets set to ON by default, assuming the prerequisites are met. However, there's a chicken-and-egg problem here. UHDBoost.cmake takes the list of required Boost components from UHD_BOOST_REQUIRED_COMPONENTS and adds them to the Boost_LIBRARIES list. This happens before ENABLE_TESTS gets a default value, so the Boost unit test framework library is never added to this list, even if ENABLE_TESTS ends up getting set to ON later on by default in the script. But, moving LIBUHD_REGISTER_COMPONENT (the macro that sets ENABLE_TESTS to a default value) to go before UHDBoost.cmake is included won't work, because that macro needs variables set by UHDBoost.cmake. It may be possible to break the circular dependency by refactoring UHDBoost.cmake somewhat, but for the time being, master shouldn't be broken. --- host/CMakeLists.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'host/CMakeLists.txt') diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index 2c5c053b5..a990585c6 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -290,12 +290,9 @@ set(UHD_BOOST_REQUIRED_COMPONENTS system serialization thread + unit_test_framework ) -if(ENABLE_TESTS) - list(APPEND UHD_BOOST_REQUIRED_COMPONENTS unit_test_framework) -endif(ENABLE_TESTS) - include(UHDBoost) include_directories(${Boost_INCLUDE_DIRS}) -- cgit v1.2.3