cmake: Remove Boost::system from component list

This has multiple reasons:

- We use CMake's FindBoost
  (https://cmake.org/cmake/help/v3.12/module/FindBoost.html) which can
  resolve dependencies itself. We only use boost::system in tandem with
  Boost::asio, which we already list as a dependency.
- There are combinations of CMake versions and Boost versions, where
  specifying this will link against the stub library of Boost::system
  (this is a header-only library since Boost 1.69). Removing it from the
  list avoids any kind of linkage.

Note that UHDBoost.cmake has some compatibility hacks for Boost::system,
which we now also remove.
This commit is contained in:
Martin Braun 2025-09-18 16:25:39 +02:00 committed by Jörg Hofrichter
parent 170f1133e5
commit c45c296d8f
4 changed files with 5 additions and 14 deletions

View File

@ -320,8 +320,8 @@ set(UHD_BOOST_REQUIRED_COMPONENTS
date_time
filesystem
program_options
system
serialization
#system Boost.System is used, but explicitly listing it causes errors on some systems.
thread
unit_test_framework
)
@ -591,9 +591,9 @@ endif(NOT CMAKE_MODULES_DIR)
list(APPEND UHD_LINK_LIST_STATIC "dl")
list(APPEND UHD_LINK_LIST_STATIC "pthread")
foreach(Boost_Comp ${UHD_BOOST_REQUIRED_COMPONENTS})
if(NOT ${Boost_Comp} STREQUAL "unit_test_framework")
if(NOT ${Boost_Comp} STREQUAL "unit_test_framework" AND NOT ${Boost_Comp} STREQUAL "system")
list(APPEND UHD_LINK_LIST_STATIC "boost_${Boost_Comp}")
endif(NOT ${Boost_Comp} STREQUAL "unit_test_framework")
endif()
endforeach(Boost_Comp)
if(ENABLE_USB)
list(APPEND UHD_LINK_LIST_STATIC "usb-1.0")

View File

@ -100,14 +100,6 @@ if(MINGW)
endif()
endif()
# if 'system' is in the list, make sure it comes last; sometimes this
# linkage makes a difference
list(FIND UHD_BOOST_REQUIRED_COMPONENTS "system" SYSTEM_NDX)
if(NOT ${SYSTEM_NDX} EQUAL -1)
list(REMOVE_AT UHD_BOOST_REQUIRED_COMPONENTS ${SYSTEM_NDX})
list(APPEND UHD_BOOST_REQUIRED_COMPONENTS "system")
endif()
# special library directory that's used by some Linux
if(UNIX AND NOT BOOST_ROOT AND EXISTS "/usr/lib64")
list(APPEND BOOST_LIBRARYDIR "/usr/lib64") #fedora 64-bit fix

View File

@ -182,7 +182,6 @@ target_link_libraries(uhd
Boost::date_time
Boost::filesystem
Boost::serialization
Boost::system
Boost::thread
${libuhd_libs}
PRIVATE uhd_rc

View File

@ -154,11 +154,11 @@ target_include_directories(pyuhd PUBLIC
)
if(WIN32)
target_link_libraries(pyuhd ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} uhd)
target_link_libraries(pyuhd ${PYTHON_LIBRARIES} uhd)
else()
# for extension module, proper to NOT link against python library and instead
# add dynamic lookup link option on OSX
target_link_libraries(pyuhd ${Boost_LIBRARIES} uhd)
target_link_libraries(pyuhd uhd)
if(APPLE)
target_link_options(pyuhd PRIVATE "LINKER:-undefined,dynamic_lookup")
endif(APPLE)