Skip to content

Commit

Permalink
Merge bitcoin#30822: cmake: scope Boost Test check to vcpkg
Browse files Browse the repository at this point in the history
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: bitcoin#30787.

ACKs for top commit:
  kevkevinpal:
    lgtm ACK [a7a4e11](bitcoin@a7a4e11)
  maflcko:
    review ACK a7a4e11
  davidgumberg:
    Tested ACK bitcoin@a7a4e11
  hebasto:
    re-ACK a7a4e11.

Tree-SHA512: 67cf3908a5381e21aeaa168a6f76b6e066d64a8ad2127d5ae9fe71a0f04bccf58a400726d9d4e228b3bdb6fca799034fd05a38388278fea30a1a841f6adac017
  • Loading branch information
fanquake committed Sep 6, 2024
2 parents 7f472e9 + a7a4e11 commit c3af4b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmake/module/AddBoostIfNeeded.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function(add_boost_if_needed)
set(CMAKE_REQUIRED_DEFINITIONS)
endif()

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

0 comments on commit c3af4b1

Please sign in to comment.