Skip to content

Commit 7ab2d8d

Browse files
committed
Only consider test dependencies of requested libraries
Don't check the test/example folders for (implicit) dependencies as BUILD_TESTING for those is disabled.
1 parent ca0f8e1 commit 7ab2d8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/BoostRoot.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ function(__boost_gather_dependencies var input_list with_test)
298298

299299
__boost_scan_dependencies(${lib} new_deps "")
300300
list(APPEND cur_dependencies ${new_deps})
301-
if(with_test)
301+
# Only consider test dependencies of the input libraries, not transitively as those tests aren't build
302+
if(with_test AND lib IN_LIST input_list)
302303
__boost_scan_dependencies(${lib} new_deps "test")
303304
list(APPEND cur_dependencies ${new_deps})
304305
__boost_scan_dependencies(${lib} new_deps "example")
@@ -326,7 +327,7 @@ if(BOOST_INCLUDE_LIBRARIES)
326327
list(REMOVE_DUPLICATES BOOST_INCLUDE_LIBRARIES)
327328
__boost_gather_dependencies(__boost_dependencies "${BOOST_INCLUDE_LIBRARIES}" OFF)
328329
if(BUILD_TESTING)
329-
__boost_gather_dependencies(__boost_test_dependencies "${BOOST_INCLUDE_LIBRARIES};${__boost_dependencies}" ON)
330+
__boost_gather_dependencies(__boost_test_dependencies "${BOOST_INCLUDE_LIBRARIES}" ON)
330331
list(REMOVE_ITEM __boost_test_dependencies ${__boost_dependencies})
331332
endif()
332333
else()

0 commit comments

Comments
 (0)