Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions builds/cmake/install-cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ main()
(--build-full-repositories) BUILD_FULL_REPOSITORIES="yes";;
(--build-use-local-src) BUILD_USE_LOCAL_SRC="yes";;
(--build-parallel=*) PARALLEL="${OPTION#*=}";;
(--build-skip-tests) BUILD_SKIP_TESTS="yes";;
(--prefix=*) PREFIX="${OPTION#*=}";;
(--verbose) DISPLAY_VERBOSE="yes";;
(--help|-h) DISPLAY_HELP="yes";;
Expand Down Expand Up @@ -316,8 +317,7 @@ main()
msg_verbose "Exporting CFLAGS '${CFLAGS}'"
else
msg_verbose "CFLAGS initially '${CFLAGS}'"
SANITIZED_CFLAGS=$(strip_optimization "$CFLAGS")
export CFLAGS="${SANITIZED_CFLAGS} ${BUILD_FLAGS}"
export CFLAGS="${CFLAGS} ${BUILD_FLAGS}"
msg_verbose "CFLAGS modified to '${CFLAGS}'"
fi

Expand All @@ -326,8 +326,7 @@ main()
msg_verbose "Exporting CXXFLAGS '${CXXFLAGS}'"
else
msg_verbose "CXXFLAGS initially '${CXXFLAGS}'"
SANITIZED_CXXFLAGS=$(strip_optimization "$CXXFLAGS")
export CXXFLAGS="${SANITIZED_CXXFLAGS} ${BUILD_FLAGS}"
export CXXFLAGS="${CXXFLAGS} ${BUILD_FLAGS}"
msg_verbose "CXXFLAGS modified to '${CXXFLAGS}'"
fi
fi
Expand Down Expand Up @@ -475,7 +474,9 @@ main()
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${libbitcoin_node_FLAGS[@]}"
build_cmake "libbitcoin-node" "builds/cmake" "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS[@]}"
test_make "libbitcoin-node" "test" "${PARALLEL}"
if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then
test_make "libbitcoin-node" "test" "${PARALLEL}"
fi
install_make "libbitcoin-node"
export CPPFLAGS="${SAVE_CPPFLAGS}"

Expand Down Expand Up @@ -787,6 +788,7 @@ display_build_variables()
msg "BUILD_LINK : ${BUILD_LINK}"
msg "BUILD_FULL_REPOSITORIES : ${BUILD_FULL_REPOSITORIES}"
msg "BUILD_USE_LOCAL_SRC : ${BUILD_USE_LOCAL_SRC}"
msg "BUILD_SKIP_TESTS : ${BUILD_SKIP_TESTS}"
msg "PARALLEL : ${PARALLEL}"
msg "PREFIX : ${PREFIX}"
msg "DISPLAY_VERBOSE : ${DISPLAY_VERBOSE}"
Expand Down Expand Up @@ -886,16 +888,6 @@ disable_exit_on_error()
eval "${OPTS_DISABLE}"
}

strip_optimization()
{
echo "$1" | sed -E '
s/-O([0-3]|s|fast|g|z|size|speed)?b?/ /g
s/-g([0-3]|gdb|dwarf[0-9]*)?b?/ /g
s/[[:space:]]+/ /g
s/^ | $//g
'
}

create_directory()
{
local DIRECTORY="$1"
Expand Down
22 changes: 7 additions & 15 deletions builds/cmake/install-presets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ main()
(--build-full-repositories) BUILD_FULL_REPOSITORIES="yes";;
(--build-use-local-src) BUILD_USE_LOCAL_SRC="yes";;
(--build-parallel=*) PARALLEL="${OPTION#*=}";;
(--build-skip-tests) BUILD_SKIP_TESTS="yes";;
(--verbose) DISPLAY_VERBOSE="yes";;
(--help|-h) DISPLAY_HELP="yes";;
(-DCMAKE_PREFIX_PATH=*) CMAKE_PREFIX_PATH="${OPTION#*=}";;
Expand Down Expand Up @@ -337,8 +338,7 @@ main()
msg_verbose "Exporting CFLAGS '${CFLAGS}'"
else
msg_verbose "CFLAGS initially '${CFLAGS}'"
SANITIZED_CFLAGS=$(strip_optimization "$CFLAGS")
export CFLAGS="${SANITIZED_CFLAGS} ${BUILD_FLAGS}"
export CFLAGS="${CFLAGS} ${BUILD_FLAGS}"
msg_verbose "CFLAGS modified to '${CFLAGS}'"
fi

Expand All @@ -347,8 +347,7 @@ main()
msg_verbose "Exporting CXXFLAGS '${CXXFLAGS}'"
else
msg_verbose "CXXFLAGS initially '${CXXFLAGS}'"
SANITIZED_CXXFLAGS=$(strip_optimization "$CXXFLAGS")
export CXXFLAGS="${SANITIZED_CXXFLAGS} ${BUILD_FLAGS}"
export CXXFLAGS="${CXXFLAGS} ${BUILD_FLAGS}"
msg_verbose "CXXFLAGS modified to '${CXXFLAGS}'"
fi
fi
Expand Down Expand Up @@ -496,7 +495,9 @@ main()
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${libbitcoin_node_FLAGS[@]}"
build_preset "libbitcoin-node" "builds/cmake" "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS[@]}"
test_make "libbitcoin-node" "test" "${PARALLEL}"
if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then
test_make "libbitcoin-node" "test" "${PARALLEL}"
fi
install_make "libbitcoin-node"
export CPPFLAGS="${SAVE_CPPFLAGS}"

Expand Down Expand Up @@ -859,6 +860,7 @@ display_build_variables()
msg "BUILD_LINK : ${BUILD_LINK}"
msg "BUILD_FULL_REPOSITORIES : ${BUILD_FULL_REPOSITORIES}"
msg "BUILD_USE_LOCAL_SRC : ${BUILD_USE_LOCAL_SRC}"
msg "BUILD_SKIP_TESTS : ${BUILD_SKIP_TESTS}"
msg "PARALLEL : ${PARALLEL}"
msg "PREFIX : ${PREFIX}"
msg "DISPLAY_VERBOSE : ${DISPLAY_VERBOSE}"
Expand Down Expand Up @@ -949,16 +951,6 @@ disable_exit_on_error()
eval "${OPTS_DISABLE}"
}

strip_optimization()
{
echo "$1" | sed -E '
s/-O([0-3]|s|fast|g|z|size|speed)?b?/ /g
s/-g([0-3]|gdb|dwarf[0-9]*)?b?/ /g
s/[[:space:]]+/ /g
s/^ | $//g
'
}

create_directory()
{
local DIRECTORY="$1"
Expand Down
22 changes: 7 additions & 15 deletions builds/gnu/install-gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ main()
(--build-full-repositories) BUILD_FULL_REPOSITORIES="yes";;
(--build-use-local-src) BUILD_USE_LOCAL_SRC="yes";;
(--build-parallel=*) PARALLEL="${OPTION#*=}";;
(--build-skip-tests) BUILD_SKIP_TESTS="yes";;
(--prefix=*) PREFIX="${OPTION#*=}";;
(--verbose) DISPLAY_VERBOSE="yes";;
(--help|-h) DISPLAY_HELP="yes";;
Expand Down Expand Up @@ -295,8 +296,7 @@ main()
msg_verbose "Exporting CFLAGS '${CFLAGS}'"
else
msg_verbose "CFLAGS initially '${CFLAGS}'"
SANITIZED_CFLAGS=$(strip_optimization "$CFLAGS")
export CFLAGS="${SANITIZED_CFLAGS} ${BUILD_FLAGS}"
export CFLAGS="${CFLAGS} ${BUILD_FLAGS}"
msg_verbose "CFLAGS modified to '${CFLAGS}'"
fi

Expand All @@ -305,8 +305,7 @@ main()
msg_verbose "Exporting CXXFLAGS '${CXXFLAGS}'"
else
msg_verbose "CXXFLAGS initially '${CXXFLAGS}'"
SANITIZED_CXXFLAGS=$(strip_optimization "$CXXFLAGS")
export CXXFLAGS="${SANITIZED_CXXFLAGS} ${BUILD_FLAGS}"
export CXXFLAGS="${CXXFLAGS} ${BUILD_FLAGS}"
msg_verbose "CXXFLAGS modified to '${CXXFLAGS}'"
fi
fi
Expand Down Expand Up @@ -464,7 +463,9 @@ main()
local SAVE_CPPFLAGS="${CPPFLAGS}"
export CPPFLAGS="${CPPFLAGS} ${libbitcoin_node_FLAGS[@]}"
build_gnu "libbitcoin-node" "." "${PARALLEL}" "${libbitcoin_node_OPTIONS[@]}" "${CONFIGURE_OPTIONS[@]}"
test_make "libbitcoin-node" "check" "${PARALLEL}"
if ! [[ "${BUILD_SKIP_TESTS}" == "yes" ]]; then
test_make "libbitcoin-node" "check" "${PARALLEL}"
fi
install_make "libbitcoin-node"
export CPPFLAGS="${SAVE_CPPFLAGS}"

Expand Down Expand Up @@ -781,6 +782,7 @@ display_build_variables()
msg "BUILD_LINK : ${BUILD_LINK}"
msg "BUILD_FULL_REPOSITORIES : ${BUILD_FULL_REPOSITORIES}"
msg "BUILD_USE_LOCAL_SRC : ${BUILD_USE_LOCAL_SRC}"
msg "BUILD_SKIP_TESTS : ${BUILD_SKIP_TESTS}"
msg "PARALLEL : ${PARALLEL}"
msg "PREFIX : ${PREFIX}"
msg "DISPLAY_VERBOSE : ${DISPLAY_VERBOSE}"
Expand Down Expand Up @@ -876,16 +878,6 @@ disable_exit_on_error()
eval "${OPTS_DISABLE}"
}

strip_optimization()
{
echo "$1" | sed -E '
s/-O([0-3]|s|fast|g|z|size|speed)?b?/ /g
s/-g([0-3]|gdb|dwarf[0-9]*)?b?/ /g
s/[[:space:]]+/ /g
s/^ | $//g
'
}

create_directory()
{
local DIRECTORY="$1"
Expand Down
69 changes: 63 additions & 6 deletions builds/msvc/build-msvc.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ REM --build-version version Build MSVC version.
REM --build-src-dir path Location of sources.
REM --build-full-repositories Sync full github repositories.
REM --build-use-local-src Use existing sources in build-src-dir path.
REM --build-mode mode Determines action on target.
REM Default: Rebuild
REM --build-symbols mode Determines treatment of symbols.
REM Values: default, disabled, public-only
REM --verbose Display verbose script output.
REM --help, -h Display usage, overriding script execution.
REM
Expand Down Expand Up @@ -127,6 +131,20 @@ if "!libbitcoin_node_TAG!" == "" (
)
)

if "!BUILD_SYMBOLS!" == "" (
call :msg_verbose "BUILD_SYMBOLS not defined or empty, defaulting to 'default' behavior."
) else if "!BUILD_SYMBOLS!" == "default" (
call :msg_verbose "BUILD_SYMBOLS 'default'."
) else if "!BUILD_SYMBOLS!" == "disabled" (
call :msg_verbose "BUILD_SYMBOLS 'disabled'."
) else if "!BUILD_SYMBOLS!" == "public-only" (
call :msg_verbose "BUILD_SYMBOLS 'public-only'."
) else (
call :msg_error "BUILD_SYMBOLS value '!BUILD_SYMBOLS!' unrecognized."
call :help
exit /b 1
)

call :msg_heading "Configuration"
call :display_build_variables

Expand Down Expand Up @@ -174,10 +192,16 @@ if "!libbitcoin_node_TAG!" == "" (
if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
)
call :build_msbuild "libbitcoin-node" "builds\msvc\%proj_version%"
call :build_msbuild "libbitcoin-node" "builds\msvc\%proj_version%" "libbitcoin-node"
if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
)
if not "!BUILD_SKIP_TESTS!" == "yes" (
call :build_msbuild "libbitcoin-node" "builds\msvc\%proj_version%" "libbitcoin-node-test"
if %ERRORLEVEL% neq 0 (
exit /b %ERRORLEVEL%
)
)

call :pop_directory
if %ERRORLEVEL% neq 0 (
Expand Down Expand Up @@ -206,10 +230,18 @@ if "!libbitcoin_node_TAG!" == "" (
) else if "%~1" == "--build-version" (
set "BUILD_VERSION=%~2"
shift
) else if "%!1" == "--build-mode" (
set "BUILD_MODE=%~2"
shift
) else if "%!1" == "--build-symbols" (
set "BUILD_SYMBOLS=%~2"
shift
) else if "%~1" == "--build-full-repositories" (
set "BUILD_FULL_REPOSITORIES=yes"
) else if "%~1" == "--build-use-local-src" (
set "BUILD_USE_LOCAL_SRC=yes"
) else if "%~1" == "--build-skip-tests" (
set "BUILD_SKIP_TESTS=yes"
) else if "%~1" == "--verbose" (
set "DISPLAY_VERBOSE=yes"
) else if "%~1" == "-v" (
Expand All @@ -218,6 +250,12 @@ if "!libbitcoin_node_TAG!" == "" (
set "SHOW_HELP=yes"
) else if "%~1" == "-h" (
set "SHOW_HELP=yes"
) else (
if "!UNHANDLED_ARGS!" == "" (
set "UNHANDLED_ARGS=%1"
) else (
set "UNHANDLED_ARGS=!UNHANDLED_ARGS! %1"
)
)

shift
Expand Down Expand Up @@ -273,10 +311,23 @@ if "!libbitcoin_node_TAG!" == "" (
set "RELATIVE_PATH=%~2"
set "TARGET=%~3"

if "%TARGET%" == "" (
set "TARGET_ARG="
if not "%TARGET%" == "" (
if not "!BUILD_MODE!" == "" (
set "TARGET_ARG=/target:%TARGET%:!BUILD_MODE!"
) else (
set "TARGET_ARG=/target:%TARGET%"
)
) else (
set "TARGET_ARG=/target:%TARGET%:Rebuild"
if not "!BUILD_MODE!" == "" (
set "TARGET_ARG=/target:!BUILD_MODE!"
)
)

set "SYMBOLS_ARG="
if "!BUILD_SYMBOLS!" == "disabled" (
set "SYMBOLS_ARG=/p:LinkerOptions=/PDBSTRIPPED "
) else if "!BUILD_SYMBOLS!" == "public-only" (
set "SYMBOLS_ARG=/p:DebugSymbols=false "
)

call :push_directory "!BUILD_SRC_DIR!\%PROJECT%\%RELATIVE_PATH%\!BUILD_VERSION!"
Expand All @@ -289,10 +340,10 @@ if "!libbitcoin_node_TAG!" == "" (
exit /b %ERRORLEVEL%
)

!MSBUILD_EXE! /verbosity:!MSBUILD_VERBOSE! /p:Platform=!BUILD_PLATFORM! /p:Configuration=!BUILD_CONFIG! /p:PreferredToolArchitecture=x64 %TARGET_ARG% %PROJECT%.sln /p:PreBuildEventUseInBuild=false /p:PostBuildEventUseInBuild=false
!MSBUILD_EXE! /verbosity:!MSBUILD_VERBOSE! !SYMBOLS_ARG!/p:Platform=!BUILD_PLATFORM! /p:Configuration=!BUILD_CONFIG! /p:PreferredToolArchitecture=x64 %TARGET_ARG% %PROJECT%.sln /p:PreBuildEventUseInBuild=false /p:PostBuildEventUseInBuild=false !UNHANDLED_ARGS!

if %ERRORLEVEL% neq 0 (
call :msg_error "!MSBUILD_EXE! /verbosity:!MSBUILD_VERBOSE! /p:Platform=!BUILD_PLATFORM! /p:Configuration=!BUILD_CONFIG! /p:PreferredToolArchitecture=x64 %TARGET_ARG% %PROJECT%.sln /p:PreBuildEventUseInBuild=false /p:PostBuildEventUseInBuild=false"
call :msg_error "!MSBUILD_EXE! /verbosity:!MSBUILD_VERBOSE! !SYMBOLS_ARG!/p:Platform=!BUILD_PLATFORM! /p:Configuration=!BUILD_CONFIG! /p:PreferredToolArchitecture=x64 %TARGET_ARG% %PROJECT%.sln /p:PreBuildEventUseInBuild=false /p:PostBuildEventUseInBuild=false !UNHANDLED_ARGS!"
call :pop_directory
exit /b 1
)
Expand All @@ -319,6 +370,8 @@ if "!libbitcoin_node_TAG!" == "" (
call :msg "BUILD_SRC_DIR : !BUILD_SRC_DIR!"
call :msg "BUILD_FULL_REPOSITORIES : !BUILD_FULL_REPOSITORIES!"
call :msg "BUILD_USE_LOCAL_SRC : !BUILD_USE_LOCAL_SRC!"
call :msg "BUILD_MODE : !BUILD_MODE!"
call :msg "BUILD_SYMBOLS : !BUILD_SYMBOLS!"
call :msg "DISPLAY_VERBOSE : !DISPLAY_VERBOSE!"
call :msg "SHOW_HELP : !SHOW_HELP!"
exit /b %ERRORLEVEL%
Expand Down Expand Up @@ -350,6 +403,10 @@ if "!libbitcoin_node_TAG!" == "" (
call :msg "--build-src-dir path Location of sources."
call :msg "--build-full-repositories Sync full github repositories."
call :msg "--build-use-local-src Use existing sources in build-src-dir path."
call :msg "--build-mode mode Determines action on target."
call :msg " Default: Rebuild"
call :msg "--build-symbols mode Determines treatment of symbols."
call :msg " Values: default, disabled, public-only"
call :msg "--verbose Display verbose script output."
call :msg "--help, -h Display usage, overriding script execution."
exit /b %ERRORLEVEL%
Expand Down