Skip to content

Commit

Permalink
Merge #312: cmake: Fix AddBoostIfNeeded module
Browse files Browse the repository at this point in the history
dcdf37a fixup! cmake: Build `bitcoind` executable (Hennadii Stepanov)

Pull request description:

  Cross-posted from bitcoin#30454 (comment):
  > Pretty sure there are two separate bugs here:
  >
  >    * The first is that `BOOST_NO_CXX98_FUNCTION_BASE` isn't removed from `CMAKE_REQUIRED_DEFINITIONS` after this check, which means it's incorrectly reused for the check below.
  >
  >    * The second is that when `-DWERROR=ON` is used, `-Werror` isn't being passed to the check for the Boost Test header (which also hides the first bug).

  This PR addresses the first part (see the commit message for more details).

  The second one remains unaddressed for the following reasons:
  1. `-DWERROR=ON` (or `--enable-debug` in Autotools) was never used to control passing the `-Werror` flag to checks of any type.
  2. In both build systems—Autotools and CMake—we do not use `-Werror` in check for header availability. It is not clear why `unit_test.hpp` should be an exception.

  Please correct me if my understanding is wrong.

Top commit has no ACKs.

Tree-SHA512: 31c81f3418bbb8c1298e413ff3617e90a46f8fda9eeed2cdcb9f520441ddc076e106e12c33064fbf69848321d881ae092e8f8307586b653d338468510ebfd2f2
  • Loading branch information
hebasto committed Aug 13, 2024
2 parents ad73445 + dcdf37a commit 7c23041
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/module/AddBoostIfNeeded.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function(add_boost_if_needed)
target_compile_definitions(Boost::headers INTERFACE
BOOST_NO_CXX98_FUNCTION_BASE
)
else()
set(CMAKE_REQUIRED_DEFINITIONS)
endif()

if(BUILD_TESTS)
Expand Down

0 comments on commit 7c23041

Please sign in to comment.