0001-host-CMakeLists-add-boost-unit_test_framework-requir.patch 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. From 881705ec581ab7cd61c8e4fe134db8854a83ec4e Mon Sep 17 00:00:00 2001
  2. From: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
  3. Date: Tue, 28 Apr 2020 16:56:29 +0200
  4. Subject: [PATCH] host: CMakeLists: add boost unit_test_framework required only
  5. when ENABLE_TESTS=ON
  6. By default, boost unit_test_framework is always required, but only use
  7. when ENABLE_TESTS=ON.
  8. This PR suppress unit_test_framework to the default list and append
  9. UHD_BOOST_REQUIRED_COMPONENTS when this library is needed
  10. [backported from https://github.com/EttusResearch/uhd/pull/341]
  11. Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
  12. ---
  13. host/CMakeLists.txt | 6 +++++-
  14. 1 file changed, 5 insertions(+), 1 deletion(-)
  15. diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
  16. index 8f72ece76..a7731ffbd 100644
  17. --- a/host/CMakeLists.txt
  18. +++ b/host/CMakeLists.txt
  19. @@ -291,10 +291,14 @@ set(UHD_BOOST_REQUIRED_COMPONENTS
  20. filesystem
  21. program_options
  22. system
  23. - unit_test_framework
  24. serialization
  25. thread
  26. )
  27. +
  28. +if(ENABLE_TESTS)
  29. + list(APPEND UHD_BOOST_REQUIRED_COMPONENTS unit_test_framework)
  30. +endif(ENABLE_TESTS)
  31. +
  32. include(UHDBoost)
  33. include_directories(${Boost_INCLUDE_DIRS})
  34. --
  35. 2.26.2