Skip to content

Commit

Permalink
boost-fallback: only check for boost if really needed (#107)
Browse files Browse the repository at this point in the history
- only check for boost if really needed (in case of legacy c++ standard < c++17)

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Notes:

    See http://lists.busybox.net/pipermail/buildroot/2022-January/635042.html
  • Loading branch information
pseiderer committed Jan 29, 2022
1 parent 5fa793b commit 5240a3d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmake/boost-fallback/boost-fallback.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ try_compile(STD_SHARED_PTR_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tes
try_compile(STD_ATOMIC_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests"
"${CMAKE_CURRENT_LIST_DIR}/test-stdatomic.cpp")

# search for boost only in case needed for legacy c++ standard < c++17
if(NOT ${STD_THREAD_FOUND} OR NOT ${STD_MUTEX_FOUND} OR NOT ${STD_SHARED_MUTEX_FOUND} OR NOT ${STD_SHARED_PTR_FOUND} OR NOT ${STD_ATOMIC_FOUND})
find_package(Boost COMPONENTS thread)
if( ${Boost_FOUND} )
try_compile(Boost_SHARED_PTR_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests"
Expand All @@ -67,6 +69,7 @@ if( ${Boost_FOUND} )
try_compile(Boost_ATOMIC_FOUND "${CMAKE_BINARY_DIR}/boost-fallback-compile-tests"
"${CMAKE_CURRENT_LIST_DIR}/test-boostatomic.cpp")
endif( ${Boost_FOUND} )
endif()

# Link the target with the appropriate boost libraries(if required)
function(boostfallback_link target)
Expand Down

0 comments on commit 5240a3d

Please sign in to comment.