diff options
author | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-05-01 14:52:42 -0500 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-05-01 15:07:01 -0500 |
commit | 1a00949b19eaecb84af0f27c370400dc71a9fd84 (patch) | |
tree | 34988fa125d0dd9b944594b2e78d9cf4124f9fc0 /host/CMakeLists.txt | |
parent | 257edd80e14c0143e87f00dbb006702986957e97 (diff) | |
download | uhd-1a00949b19eaecb84af0f27c370400dc71a9fd84.tar.gz uhd-1a00949b19eaecb84af0f27c370400dc71a9fd84.tar.bz2 uhd-1a00949b19eaecb84af0f27c370400dc71a9fd84.zip |
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.
Diffstat (limited to 'host/CMakeLists.txt')
-rw-r--r-- | host/CMakeLists.txt | 5 |
1 files changed, 1 insertions, 4 deletions
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}) |