diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6771ea73..81a83f42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,9 +180,10 @@ jobs: - name: Coveralls.io Upload if: ${{ matrix.coverage == 'cov' }} - uses: pmienk/coveralls-github-action@master + uses: coverallsapp/github-action@v2.2.3 with: - path-to-lcov: "./coverage.info" + format: lcov + files: "./coverage.info" github-token: ${{ secrets.github_token }} - name: Failure display available binaries @@ -406,9 +407,10 @@ jobs: - name: Coveralls.io Upload if: ${{ matrix.coverage == 'cov' }} - uses: pmienk/coveralls-github-action@master + uses: coverallsapp/github-action@v2.2.3 with: - path-to-lcov: "./coverage.info" + format: lcov + files: "./coverage.info" github-token: ${{ secrets.github_token }} - name: Failure display available binaries @@ -604,9 +606,10 @@ jobs: - name: Coveralls.io Upload if: ${{ matrix.coverage == 'cov' }} - uses: pmienk/coveralls-github-action@master + uses: coverallsapp/github-action@v2.2.3 with: - path-to-lcov: "./coverage.info" + format: lcov + files: "./coverage.info" github-token: ${{ secrets.github_token }} - name: Failure display available binaries @@ -701,7 +704,7 @@ jobs: steps: - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 with: msbuild-architecture: x64 @@ -731,7 +734,7 @@ jobs: } - name: Execute build - run: .\build.cmd .. ${{ matrix.platform }} ${{ matrix.configuration }} ${{ matrix.version }} + run: .\build.cmd .. ${{ matrix.platform }} ${{ matrix.configuration }} x64 ${{ matrix.version }} - name: Execute tests shell: powershell diff --git a/build.cmd b/build.cmd index 3be6e50a..14c0112b 100644 --- a/build.cmd +++ b/build.cmd @@ -11,10 +11,10 @@ SET "relative_path_base=%~1" call cd /d "%relative_path_base%" SET "path_base=%cd%" SET "nuget_pkg_path=%path_base%\.nuget\packages" -SET "msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3" -SET "proj_version=%~4" +SET "msbuild_args=/verbosity:minimal /p:Platform=%~2 /p:Configuration=%~3 /p:PreferredToolArchitecture=%~4" +SET "proj_version=%~5" SET "msbuild_exe=msbuild" -IF EXIST "%~5" SET "msbuild_exe=%~5" +IF EXIST "%~6" SET "msbuild_exe=%~6" call :pending "Build initialized..." IF NOT EXIST "%nuget_pkg_path%" ( diff --git a/builds/cmake/CMakeLists.txt b/builds/cmake/CMakeLists.txt index 2538949c..8fa139e1 100644 --- a/builds/cmake/CMakeLists.txt +++ b/builds/cmake/CMakeLists.txt @@ -45,7 +45,7 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON ) # Warn on all stuff. check_cxx_compiler_flag( "-Wall" HAS_FLAG_WALL ) if ( HAS_FLAG_WALL ) - add_compile_options( "-Wall" ) + add_compile_options( $<$:-Wall> ) else() message( FATAL_ERROR "Compiler does not support -Wall" ) endif() @@ -53,7 +53,7 @@ endif() # Warn on extra stuff. check_cxx_compiler_flag( "-Wextra" HAS_FLAG_WEXTRA ) if ( HAS_FLAG_WEXTRA ) - add_compile_options( "-Wextra" ) + add_compile_options( $<$:-Wextra> ) else() message( FATAL_ERROR "Compiler does not support -Wextra" ) endif() @@ -61,7 +61,7 @@ endif() # Disallow warning on style order of declarations. check_cxx_compiler_flag( "-Wno-reorder" HAS_FLAG_WNO-REORDER ) if ( HAS_FLAG_WNO-REORDER ) - add_compile_options( "-Wno-reorder" ) + add_compile_options( $<$:-Wno-reorder> ) else() message( FATAL_ERROR "Compiler does not support -Wno-reorder" ) endif() @@ -69,7 +69,7 @@ endif() # Suppress warning for incomplete field initialization. check_cxx_compiler_flag( "-Wno-missing-field-initializers" HAS_FLAG_WNO-MISSING-FIELD-INITIALIZERS ) if ( HAS_FLAG_WNO-MISSING-FIELD-INITIALIZERS ) - add_compile_options( "-Wno-missing-field-initializers" ) + add_compile_options( $<$:-Wno-missing-field-initializers> ) else() message( FATAL_ERROR "Compiler does not support -Wno-missing-field-initializers" ) endif() @@ -77,7 +77,7 @@ endif() # Conform to style. check_cxx_compiler_flag( "-Wno-missing-braces" HAS_FLAG_WNO-MISSING-BRACES ) if ( HAS_FLAG_WNO-MISSING-BRACES ) - add_compile_options( "-Wno-missing-braces" ) + add_compile_options( $<$:-Wno-missing-braces> ) else() message( FATAL_ERROR "Compiler does not support -Wno-missing-braces" ) endif() @@ -85,7 +85,7 @@ endif() # Ignore comments within comments or commenting of backslash extended lines. check_cxx_compiler_flag( "-Wno-comment" HAS_FLAG_WNO-COMMENT ) if ( HAS_FLAG_WNO-COMMENT ) - add_compile_options( "-Wno-comment" ) + add_compile_options( $<$:-Wno-comment> ) else() message( FATAL_ERROR "Compiler does not support -Wno-comment" ) endif() @@ -93,7 +93,7 @@ endif() # Suppress warning for copy of implicitly generated copy constructor. check_cxx_compiler_flag( "-Wno-deprecated-copy" HAS_FLAG_WNO-DEPRECATED-COPY ) if ( HAS_FLAG_WNO-DEPRECATED-COPY ) - add_compile_options( "-Wno-deprecated-copy" ) + add_compile_options( $<$:-Wno-deprecated-copy> ) else() message( FATAL_ERROR "Compiler does not support -Wno-deprecated-copy" ) endif() @@ -101,7 +101,7 @@ endif() # Suppress frequent warning in cloned files. check_cxx_compiler_flag( "-Wno-unused-parameter" HAS_FLAG_WNO-UNUSED-PARAMETER ) if ( HAS_FLAG_WNO-UNUSED-PARAMETER ) - add_compile_options( "-Wno-unused-parameter" ) + add_compile_options( $<$:-Wno-unused-parameter> ) else() message( FATAL_ERROR "Compiler does not support -Wno-unused-parameter" ) endif() @@ -110,7 +110,7 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") check_cxx_compiler_flag( "-Wno-mismatched-tags" HAS_FLAG_WNO-MISMATCHED-TAGS ) if ( HAS_FLAG_WNO-MISMATCHED-TAGS ) - add_compile_options( "-Wno-mismatched-tags" ) + add_compile_options( $<$:-Wno-mismatched-tags> ) else() message( FATAL_ERROR "Compiler does not support -Wno-mismatched-tags" ) endif() @@ -120,7 +120,7 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") check_cxx_compiler_flag( "-Wno-c++17-extensions" HAS_FLAG_WNO-C++17-EXTENSIONS ) if ( HAS_FLAG_WNO-C++17-EXTENSIONS ) - add_compile_options( "-Wno-c++17-extensions" ) + add_compile_options( $<$:-Wno-c++17-extensions> ) else() message( FATAL_ERROR "Compiler does not support -Wno-c++17-extensions" ) endif() diff --git a/builds/cmake/CMakePresets.json b/builds/cmake/CMakePresets.json index 46592d0c..2e51cf0b 100644 --- a/builds/cmake/CMakePresets.json +++ b/builds/cmake/CMakePresets.json @@ -79,8 +79,8 @@ "description": "Factored size optimization settings.", "hidden": true, "cacheVariables": { - "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Os -s", - "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Os -s" + "CMAKE_C_FLAGS": "$env{CMAKE_C_FLAGS} -Os", + "CMAKE_CXX_FLAGS": "$env{CMAKE_CXX_FLAGS} -Os" } }, { diff --git a/install-cmake.sh b/install-cmake.sh index 6f433618..8c5201bf 100755 --- a/install-cmake.sh +++ b/install-cmake.sh @@ -834,7 +834,12 @@ build_from_tarball_boost() display_message "BOOST_OPTIONS : $*" display_message "--------------------------------------------------------------------" + guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset` + CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w" + cp tools/build/src/engine/b2 . + ./bootstrap.sh \ + "--with-bjam=./b2" \ "--prefix=$PREFIX" \ "--with-icu=$ICU_PREFIX" @@ -852,6 +857,7 @@ build_from_tarball_boost() "$BOOST_CXXFLAGS" \ "$BOOST_LINKFLAGS" \ "link=$BOOST_LINK" \ + "warnings=off" \ "boost.locale.iconv=$BOOST_ICU_ICONV" \ "boost.locale.posix=$BOOST_ICU_POSIX" \ "-sNO_BZIP2=1" \ @@ -875,9 +881,17 @@ build_from_tarball_boost() build_all() { unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST" + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}" build_from_tarball_boost "$BOOST_ARCHIVE" "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}" + export CPPFLAGS=$SAVE_CPPFLAGS create_from_github libbitcoin secp256k1 version8 "yes" + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${SECP256K1_FLAGS[@]}" build_from_github secp256k1 "$PARALLEL" false "yes" "${SECP256K1_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS + export CPPFLAGS=$SAVE_CPPFLAGS + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${BITCOIN_CONSENSUS_FLAGS[@]}" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-consensus master "yes" build_from_github_cmake libbitcoin-consensus "$PARALLEL" true "yes" "${BITCOIN_CONSENSUS_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS_CMAKE "$@" @@ -888,6 +902,7 @@ build_all() pop_directory pop_directory fi + export CPPFLAGS=$SAVE_CPPFLAGS } @@ -909,6 +924,14 @@ set_with_boost_prefix remove_install_options +# Define build flags. +#============================================================================== +# Define secp256k1 flags. +#------------------------------------------------------------------------------ +SECP256K1_FLAGS=( +"-w") + + # Define build options. #============================================================================== # Define boost options. diff --git a/install-cmakepresets.sh b/install-cmakepresets.sh index d42d20ee..087a32eb 100755 --- a/install-cmakepresets.sh +++ b/install-cmakepresets.sh @@ -879,7 +879,12 @@ build_from_tarball_boost() display_message "BOOST_OPTIONS : $*" display_message "--------------------------------------------------------------------" + guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset` + CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w" + cp tools/build/src/engine/b2 . + ./bootstrap.sh \ + "--with-bjam=./b2" \ "--prefix=$PREFIX" \ "--with-icu=$ICU_PREFIX" @@ -897,6 +902,7 @@ build_from_tarball_boost() "$BOOST_CXXFLAGS" \ "$BOOST_LINKFLAGS" \ "link=$BOOST_LINK" \ + "warnings=off" \ "boost.locale.iconv=$BOOST_ICU_ICONV" \ "boost.locale.posix=$BOOST_ICU_POSIX" \ "-sNO_BZIP2=1" \ @@ -920,9 +926,17 @@ build_from_tarball_boost() build_all() { unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST" + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}" build_from_tarball_boost "$BOOST_ARCHIVE" "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}" + export CPPFLAGS=$SAVE_CPPFLAGS create_from_github libbitcoin secp256k1 version8 "yes" + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${SECP256K1_FLAGS[@]}" build_from_github secp256k1 "$PARALLEL" false "yes" "${SECP256K1_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS + export CPPFLAGS=$SAVE_CPPFLAGS + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${BITCOIN_CONSENSUS_FLAGS[@]}" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-consensus master "yes" display_message "libbitcoin-consensus PRESET ${REPO_PRESET[libbitcoin-consensus]}" @@ -935,6 +949,7 @@ build_all() pop_directory pop_directory fi + export CPPFLAGS=$SAVE_CPPFLAGS } @@ -956,6 +971,14 @@ set_with_boost_prefix remove_install_options +# Define build flags. +#============================================================================== +# Define secp256k1 flags. +#------------------------------------------------------------------------------ +SECP256K1_FLAGS=( +"-w") + + # Define build options. #============================================================================== # Define boost options. diff --git a/install.sh b/install.sh index e0f71547..f8d80ab4 100755 --- a/install.sh +++ b/install.sh @@ -706,7 +706,12 @@ build_from_tarball_boost() display_message "BOOST_OPTIONS : $*" display_message "--------------------------------------------------------------------" + guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset` + CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w" + cp tools/build/src/engine/b2 . + ./bootstrap.sh \ + "--with-bjam=./b2" \ "--prefix=$PREFIX" \ "--with-icu=$ICU_PREFIX" @@ -724,6 +729,7 @@ build_from_tarball_boost() "$BOOST_CXXFLAGS" \ "$BOOST_LINKFLAGS" \ "link=$BOOST_LINK" \ + "warnings=off" \ "boost.locale.iconv=$BOOST_ICU_ICONV" \ "boost.locale.posix=$BOOST_ICU_POSIX" \ "-sNO_BZIP2=1" \ @@ -747,9 +753,17 @@ build_from_tarball_boost() build_all() { unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST" + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}" build_from_tarball_boost "$BOOST_ARCHIVE" "$PARALLEL" "$BUILD_BOOST" "${BOOST_OPTIONS[@]}" + export CPPFLAGS=$SAVE_CPPFLAGS create_from_github libbitcoin secp256k1 version8 "yes" + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${SECP256K1_FLAGS[@]}" build_from_github secp256k1 "$PARALLEL" false "yes" "${SECP256K1_OPTIONS[@]}" "$@" + export CPPFLAGS=$SAVE_CPPFLAGS + local SAVE_CPPFLAGS="$CPPFLAGS" + export CPPFLAGS="$CPPFLAGS ${BITCOIN_CONSENSUS_FLAGS[@]}" if [[ ! ($CI == true) ]]; then create_from_github libbitcoin libbitcoin-consensus master "yes" build_from_github libbitcoin-consensus "$PARALLEL" true "yes" "${BITCOIN_CONSENSUS_OPTIONS[@]}" "$@" @@ -760,6 +774,7 @@ build_all() pop_directory pop_directory fi + export CPPFLAGS=$SAVE_CPPFLAGS } @@ -780,6 +795,14 @@ set_pkgconfigdir set_with_boost_prefix +# Define build flags. +#============================================================================== +# Define secp256k1 flags. +#------------------------------------------------------------------------------ +SECP256K1_FLAGS=( +"-w") + + # Define build options. #============================================================================== # Define boost options.