Skip to content

Commit db8350b

Browse files
committed
Merge bitcoin/bitcoin#30803: build: Minor build system fixes and amendments
1cc93fe build: Delete dead code that implements `IF_CHECK_FAILED` option (Hennadii Stepanov) 341ad23 build: Delete MSVC special case for `BUILD_FOR_FUZZING` option (Hennadii Stepanov) fdad128 build: Stop enabling CMake's CMP0141 policy (Hennadii Stepanov) b2a6f54 doc: Drop `ctest` command from Windows cross-compiling instructions (Hennadii Stepanov) 73b6185 build: Print `CMAKE_CXX_COMPILER_ARG1` in summary (Hennadii Stepanov) f03c942 build, test: Add missed log options (Hennadii Stepanov) 6f2cb0e doc: Amend comment about ZeroMQ config files (Hennadii Stepanov) Pull request description: This PR addresses the following comments: - bitcoin/bitcoin#30454 (comment) - bitcoin/bitcoin#30454 (comment) - bitcoin/bitcoin#30454 (comment) - bitcoin/bitcoin#30454 (comment) - bitcoin/bitcoin#30454 (comment) - bitcoin/bitcoin#30454 (comment) - bitcoin/bitcoin#30454 (comment) ACKs for top commit: sipsorcery: tACK 1cc93fe (win11 msvc). maflcko: re-ACK 1cc93fe Tree-SHA512: a390797bb4d3b7eb9163653b6c9c324e7a01090f6cdda74df7349a24a5c4a2084e5912878747f56561315afc70cae9adb1c363f47ceb0af96004ea591d25171b
2 parents a86e7a4 + 1cc93fe commit db8350b

File tree

6 files changed

+9
-33
lines changed

6 files changed

+9
-33
lines changed

CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
# Centos Stream 9, https://www.centos.org/cl-vs-cs/#end-of-life, EOL in May 2027:
99
# - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/
1010
cmake_minimum_required(VERSION 3.22)
11-
if(POLICY CMP0141)
12-
# MSVC debug information format flags are selected by an abstraction.
13-
# We want to use the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT variable
14-
# to select the MSVC debug information format.
15-
cmake_policy(SET CMP0141 NEW)
16-
endif()
1711

1812
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
1913
message(FATAL_ERROR "In-source builds are not allowed.")
@@ -143,7 +137,9 @@ if(WITH_ZMQ)
143137
find_package(ZeroMQ CONFIG REQUIRED)
144138
else()
145139
# The ZeroMQ project has provided config files since v4.2.2.
146-
# TODO: Switch to find_package(ZeroMQ) at some point in the future.
140+
# However, mainstream distributions do not yet provide CMake
141+
# config files for ZeroMQ packages. If they do in the future,
142+
# find_package(ZeroMQ) may be used instead.
147143
find_package(PkgConfig REQUIRED)
148144
pkg_check_modules(libzmq REQUIRED IMPORTED_TARGET libzmq>=4)
149145
endif()
@@ -194,7 +190,7 @@ endif()
194190

195191
option(BUILD_BENCH "Build bench_bitcoin executable." OFF)
196192
option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF)
197-
cmake_dependent_option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF)
193+
option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF)
198194

199195
option(INSTALL_MAN "Install man pages." ON)
200196

cmake/module/FlagsSummary.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function(print_flags_per_config config indent_num)
2222
get_target_interface(definitions "${config}" core_interface COMPILE_DEFINITIONS)
2323
indent_message("Preprocessor defined macros ..........." "${definitions}" ${indent_num})
2424

25-
string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags)
25+
string(STRIP "${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_FLAGS}" combined_cxx_flags)
26+
string(STRIP "${combined_cxx_flags} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags)
2627
string(STRIP "${combined_cxx_flags} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" combined_cxx_flags)
2728
if(CMAKE_POSITION_INDEPENDENT_CODE)
2829
string(JOIN " " combined_cxx_flags ${combined_cxx_flags} ${CMAKE_CXX_COMPILE_OPTIONS_PIC})

cmake/module/TryAppendCXXFlags.cmake

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ Usage examples:
3232
)
3333
3434
35-
try_append_cxx_flags("-Werror=return-type" TARGET core_interface
36-
IF_CHECK_FAILED "-Wno-error=return-type"
37-
SOURCE "#include <cassert>\nint f(){ assert(false); }"
38-
)
39-
40-
4135
In configuration output, this function prints a string by the following pattern:
4236
4337
-- Performing Test CXX_SUPPORTS_[flags]
@@ -49,7 +43,7 @@ function(try_append_cxx_flags flags)
4943
TACXXF # prefix
5044
"SKIP_LINK" # options
5145
"TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords
52-
"IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords
46+
"IF_CHECK_PASSED" # multi_value_keywords
5347
)
5448

5549
set(flags_as_string "${flags}")
@@ -88,13 +82,6 @@ function(try_append_cxx_flags flags)
8882
string(STRIP "${${TACXXF_VAR}} ${flags_as_string}" ${TACXXF_VAR})
8983
endif()
9084
endif()
91-
elseif(DEFINED TACXXF_IF_CHECK_FAILED)
92-
if(DEFINED TACXXF_TARGET)
93-
target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED})
94-
endif()
95-
if(DEFINED TACXXF_VAR)
96-
string(STRIP "${${TACXXF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TACXXF_VAR})
97-
endif()
9885
endif()
9986

10087
if(DEFINED TACXXF_VAR)

cmake/module/TryAppendLinkerFlag.cmake

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function(try_append_linker_flag flag)
2222
TALF # prefix
2323
"" # options
2424
"TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords
25-
"IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords
25+
"IF_CHECK_PASSED" # multi_value_keywords
2626
)
2727

2828
string(MAKE_C_IDENTIFIER "${flag}" result)
@@ -58,13 +58,6 @@ function(try_append_linker_flag flag)
5858
string(STRIP "${${TALF_VAR}} ${flag}" ${TALF_VAR})
5959
endif()
6060
endif()
61-
elseif(DEFINED TALF_IF_CHECK_FAILED)
62-
if(DEFINED TALF_TARGET)
63-
target_link_options(${TALF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED})
64-
endif()
65-
if(DEFINED TALF_VAR)
66-
string(STRIP "${${TALF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TALF_VAR})
67-
endif()
6861
endif()
6962

7063
if(DEFINED TALF_VAR)

doc/build-windows.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ Build using:
6767
gmake -C depends HOST=x86_64-w64-mingw32 # Use "-j N" for N parallel jobs.
6868
cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake
6969
cmake --build build # Use "-j N" for N parallel jobs.
70-
ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
7170

7271
## Depends system
7372

src/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function(add_boost_test source_file)
196196
)
197197
if(test_suite_name)
198198
add_test(NAME ${test_suite_name}
199-
COMMAND test_bitcoin --run_test=${test_suite_name} --catch_system_error=no
199+
COMMAND test_bitcoin --run_test=${test_suite_name} --catch_system_error=no --log_level=test_suite -- DEBUG_LOG_OUT
200200
)
201201
set_property(TEST ${test_suite_name} PROPERTY
202202
SKIP_REGULAR_EXPRESSION "no test cases matching filter" "Skipping"

0 commit comments

Comments
 (0)