Skip to content

Commit c3af4b1

Browse files
committed
Merge bitcoin/bitcoin#30822: cmake: scope Boost Test check to vcpkg
a7a4e11 cmake: scope Boost Test check to vcpkg (fanquake) Pull request description: This check was added for `vcpkg`, given how it packages Boost. However, we don't need to run the check for other platforms, and it's quite slow. So, scope it to just `vcpkg`. On my machine, this reduces the time to run `time cmake -B build` from ~12 seconds, to ~6 seconds. Fixes: #30787. ACKs for top commit: kevkevinpal: lgtm ACK [a7a4e11](bitcoin/bitcoin@a7a4e11) maflcko: review ACK a7a4e11 davidgumberg: Tested ACK bitcoin/bitcoin@a7a4e11 hebasto: re-ACK a7a4e11. Tree-SHA512: 67cf3908a5381e21aeaa168a6f76b6e066d64a8ad2127d5ae9fe71a0f04bccf58a400726d9d4e228b3bdb6fca799034fd05a38388278fea30a1a841f6adac017
2 parents 7f472e9 + a7a4e11 commit c3af4b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake/module/AddBoostIfNeeded.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ function(add_boost_if_needed)
6464
set(CMAKE_REQUIRED_DEFINITIONS)
6565
endif()
6666

67-
if(BUILD_TESTS)
68-
# Some package managers, such as vcpkg, vendor Boost.Test separately
69-
# from the rest of the headers, so we have to check for it individually.
67+
# Some package managers, such as vcpkg, vendor Boost.Test separately
68+
# from the rest of the headers, so we have to check for it individually.
69+
if(BUILD_TESTS AND DEFINED VCPKG_TARGET_TRIPLET)
7070
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DBOOST_TEST_NO_MAIN)
7171
include(CheckIncludeFileCXX)
7272
check_include_file_cxx(boost/test/included/unit_test.hpp HAVE_BOOST_INCLUDED_UNIT_TEST_H)

0 commit comments

Comments
 (0)