From 6f2cb0eafdef81fb9464a4679c3a5905d19e5103 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 4 Sep 2024 03:40:34 +0100 Subject: [PATCH 1/7] doc: Amend comment about ZeroMQ config files --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ef80ffc6f9..3aba137d09a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,7 +145,9 @@ if(WITH_ZMQ) find_package(ZeroMQ CONFIG REQUIRED) else() # The ZeroMQ project has provided config files since v4.2.2. - # TODO: Switch to find_package(ZeroMQ) at some point in the future. + # However, mainstream distributions do not yet provide CMake + # config files for ZeroMQ packages. If they do in the future, + # find_package(ZeroMQ) may be used instead. find_package(PkgConfig REQUIRED) pkg_check_modules(libzmq REQUIRED IMPORTED_TARGET libzmq>=4) endif() From f03c9420958de31fdfecec5fa3e23134aac61803 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:05:49 +0100 Subject: [PATCH 2/7] build, test: Add missed log options --- src/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 4e24b87e9b7..92714a343e0 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -196,7 +196,7 @@ function(add_boost_test source_file) ) if(test_suite_name) add_test(NAME ${test_suite_name} - COMMAND test_bitcoin --run_test=${test_suite_name} --catch_system_error=no + COMMAND test_bitcoin --run_test=${test_suite_name} --catch_system_error=no --log_level=test_suite -- DEBUG_LOG_OUT ) set_property(TEST ${test_suite_name} PROPERTY SKIP_REGULAR_EXPRESSION "no test cases matching filter" "Skipping" From 73b618582dcf06dd01be062fe0f81060cfcb48d8 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:18:48 +0100 Subject: [PATCH 3/7] build: Print `CMAKE_CXX_COMPILER_ARG1` in summary When `-DCMAKE_CXX_COMPILER='clang++;-stdlib=libc++;-m32'` is provided, `-stdlib=libc++ -m32` flags are printed in the summary now. --- cmake/module/FlagsSummary.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/module/FlagsSummary.cmake b/cmake/module/FlagsSummary.cmake index 9a408f715d9..91d1df90d99 100644 --- a/cmake/module/FlagsSummary.cmake +++ b/cmake/module/FlagsSummary.cmake @@ -22,7 +22,8 @@ function(print_flags_per_config config indent_num) get_target_interface(definitions "${config}" core_interface COMPILE_DEFINITIONS) indent_message("Preprocessor defined macros ..........." "${definitions}" ${indent_num}) - string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags) + string(STRIP "${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_FLAGS}" combined_cxx_flags) + string(STRIP "${combined_cxx_flags} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags) string(STRIP "${combined_cxx_flags} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" combined_cxx_flags) if(CMAKE_POSITION_INDEPENDENT_CODE) string(JOIN " " combined_cxx_flags ${combined_cxx_flags} ${CMAKE_CXX_COMPILE_OPTIONS_PIC}) From b2a6f545b4f6e3442ae51f66a6f3c1de92d00a1b Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Wed, 4 Sep 2024 08:09:11 +0100 Subject: [PATCH 4/7] doc: Drop `ctest` command from Windows cross-compiling instructions The ctest command was added hastily without considering the requirement of Wine, which is generally not trivial to install. --- doc/build-windows.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/build-windows.md b/doc/build-windows.md index 2d47d120e3f..2e7b93da35f 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -67,7 +67,6 @@ Build using: gmake -C depends HOST=x86_64-w64-mingw32 # Use "-j N" for N parallel jobs. cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake cmake --build build # Use "-j N" for N parallel jobs. - ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. ## Depends system From fdad128b528bc8622bc6d8343026c28b18260f64 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:07:31 +0100 Subject: [PATCH 5/7] build: Stop enabling CMake's CMP0141 policy The `CMAKE_MSVC_DEBUG_INFORMATION_FORMAT` variable has not been used since the merge of https://github.com/hebasto/bitcoin/pull/215 in the CMake staging branch. --- CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3aba137d09a..c636b3bf3fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,12 +8,6 @@ # Centos Stream 9, https://www.centos.org/cl-vs-cs/#end-of-life, EOL in May 2027: # - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/ cmake_minimum_required(VERSION 3.22) -if(POLICY CMP0141) - # MSVC debug information format flags are selected by an abstraction. - # We want to use the CMAKE_MSVC_DEBUG_INFORMATION_FORMAT variable - # to select the MSVC debug information format. - cmake_policy(SET CMP0141 NEW) -endif() if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "In-source builds are not allowed.") From 341ad238091d4df520c70f1757b017e6f6620f24 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 8 Sep 2024 11:03:32 +0100 Subject: [PATCH 6/7] build: Delete MSVC special case for `BUILD_FOR_FUZZING` option --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c636b3bf3fc..2213d3d0c9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,7 +192,7 @@ endif() option(BUILD_BENCH "Build bench_bitcoin executable." OFF) option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF) -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) +option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF) option(INSTALL_MAN "Install man pages." ON) From 1cc93fe7b40f10a7d1d1189058af98a2bce31381 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 8 Sep 2024 16:34:04 +0100 Subject: [PATCH 7/7] build: Delete dead code that implements `IF_CHECK_FAILED` option --- cmake/module/TryAppendCXXFlags.cmake | 15 +-------------- cmake/module/TryAppendLinkerFlag.cmake | 9 +-------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/cmake/module/TryAppendCXXFlags.cmake b/cmake/module/TryAppendCXXFlags.cmake index 0f6e014d437..c07455e89e0 100644 --- a/cmake/module/TryAppendCXXFlags.cmake +++ b/cmake/module/TryAppendCXXFlags.cmake @@ -32,12 +32,6 @@ Usage examples: ) - try_append_cxx_flags("-Werror=return-type" TARGET core_interface - IF_CHECK_FAILED "-Wno-error=return-type" - SOURCE "#include \nint f(){ assert(false); }" - ) - - In configuration output, this function prints a string by the following pattern: -- Performing Test CXX_SUPPORTS_[flags] @@ -49,7 +43,7 @@ function(try_append_cxx_flags flags) TACXXF # prefix "SKIP_LINK" # options "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords - "IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords + "IF_CHECK_PASSED" # multi_value_keywords ) set(flags_as_string "${flags}") @@ -88,13 +82,6 @@ function(try_append_cxx_flags flags) string(STRIP "${${TACXXF_VAR}} ${flags_as_string}" ${TACXXF_VAR}) endif() endif() - elseif(DEFINED TACXXF_IF_CHECK_FAILED) - if(DEFINED TACXXF_TARGET) - target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED}) - endif() - if(DEFINED TACXXF_VAR) - string(STRIP "${${TACXXF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TACXXF_VAR}) - endif() endif() if(DEFINED TACXXF_VAR) diff --git a/cmake/module/TryAppendLinkerFlag.cmake b/cmake/module/TryAppendLinkerFlag.cmake index 749120d4458..8cbd83678d9 100644 --- a/cmake/module/TryAppendLinkerFlag.cmake +++ b/cmake/module/TryAppendLinkerFlag.cmake @@ -22,7 +22,7 @@ function(try_append_linker_flag flag) TALF # prefix "" # options "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords - "IF_CHECK_PASSED;IF_CHECK_FAILED" # multi_value_keywords + "IF_CHECK_PASSED" # multi_value_keywords ) string(MAKE_C_IDENTIFIER "${flag}" result) @@ -58,13 +58,6 @@ function(try_append_linker_flag flag) string(STRIP "${${TALF_VAR}} ${flag}" ${TALF_VAR}) endif() endif() - elseif(DEFINED TALF_IF_CHECK_FAILED) - if(DEFINED TALF_TARGET) - target_link_options(${TALF_TARGET} INTERFACE ${TACXXF_IF_CHECK_FAILED}) - endif() - if(DEFINED TALF_VAR) - string(STRIP "${${TALF_VAR}} ${TACXXF_IF_CHECK_FAILED}" ${TALF_VAR}) - endif() endif() if(DEFINED TALF_VAR)