mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 02:33:24 -03:00
cmake: scope Boost Test check to vcpkg
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 VCPKG. On my machine, this reduces the time to run `cmake -B build` from ~12 seconds, to ~6 seconds. Fixes: #30787
This commit is contained in:
parent
d661e2b1b7
commit
a7a4e11db8
1 changed files with 3 additions and 3 deletions
|
@ -64,9 +64,9 @@ function(add_boost_if_needed)
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS)
|
set(CMAKE_REQUIRED_DEFINITIONS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
# Some package managers, such as vcpkg, vendor Boost.Test separately
|
||||||
# Some package managers, such as vcpkg, vendor Boost.Test separately
|
# from the rest of the headers, so we have to check for it individually.
|
||||||
# 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)
|
list(APPEND CMAKE_REQUIRED_DEFINITIONS -DBOOST_TEST_NO_MAIN)
|
||||||
include(CheckIncludeFileCXX)
|
include(CheckIncludeFileCXX)
|
||||||
check_include_file_cxx(boost/test/included/unit_test.hpp HAVE_BOOST_INCLUDED_UNIT_TEST_H)
|
check_include_file_cxx(boost/test/included/unit_test.hpp HAVE_BOOST_INCLUDED_UNIT_TEST_H)
|
||||||
|
|
Loading…
Add table
Reference in a new issue