@@ -17,6 +17,10 @@ REM --build-version version Build MSVC version.
1717REM --build-src-dir path Location of sources.
1818REM --build-full-repositories Sync full github repositories.
1919REM --build-use-local-src Use existing sources in build-src-dir path.
20+ REM --build-mode mode Determines action on target.
21+ REM Default: Rebuild
22+ REM --build-symbols mode Determines treatment of symbols.
23+ REM Values: default, disabled, public-only
2024REM --verbose Display verbose script output.
2125REM --help, -h Display usage, overriding script execution.
2226REM
@@ -134,6 +138,20 @@ if "!libbitcoin_server_TAG!" == "" (
134138 )
135139 )
136140
141+ if " !BUILD_SYMBOLS! " == " " (
142+ call :msg_verbose " BUILD_SYMBOLS not defined or empty, defaulting to 'default' behavior."
143+ ) else if " !BUILD_SYMBOLS! " == " default" (
144+ call :msg_verbose " BUILD_SYMBOLS 'default'."
145+ ) else if " !BUILD_SYMBOLS! " == " disabled" (
146+ call :msg_verbose " BUILD_SYMBOLS 'disabled'."
147+ ) else if " !BUILD_SYMBOLS! " == " public-only" (
148+ call :msg_verbose " BUILD_SYMBOLS 'public-only'."
149+ ) else (
150+ call :msg_error " BUILD_SYMBOLS value '!BUILD_SYMBOLS! ' unrecognized."
151+ call :help
152+ exit /b 1
153+ )
154+
137155 call :msg_heading " Configuration"
138156 call :display_build_variables
139157
@@ -190,10 +208,20 @@ if "!libbitcoin_server_TAG!" == "" (
190208 if %ERRORLEVEL% neq 0 (
191209 exit /b %ERRORLEVEL%
192210 )
193- call :build_msbuild " libbitcoin-server" " builds\msvc\%proj_version% "
211+ call :build_msbuild " libbitcoin-server" " builds\msvc\%proj_version% " " libbitcoin-server"
212+ if %ERRORLEVEL% neq 0 (
213+ exit /b %ERRORLEVEL%
214+ )
215+ call :build_msbuild " libbitcoin-server" " builds\msvc\%proj_version% " " bs"
216+ if %ERRORLEVEL% neq 0 (
217+ exit /b %ERRORLEVEL%
218+ )
219+ if not " !BUILD_SKIP_TESTS! " == " yes" (
220+ call :build_msbuild " libbitcoin-server" " builds\msvc\%proj_version% " " libbitcoin-server-test"
194221 if %ERRORLEVEL% neq 0 (
195222 exit /b %ERRORLEVEL%
196223 )
224+ )
197225
198226 call :pop_directory
199227 if %ERRORLEVEL% neq 0 (
@@ -222,10 +250,18 @@ if "!libbitcoin_server_TAG!" == "" (
222250 ) else if " %~1 " == " --build-version" (
223251 set " BUILD_VERSION = %~2 "
224252 shift
253+ ) else if " %!1" == " --build-mode" (
254+ set " BUILD_MODE = %~2 "
255+ shift
256+ ) else if " %!1" == " --build-symbols" (
257+ set " BUILD_SYMBOLS = %~2 "
258+ shift
225259 ) else if " %~1 " == " --build-full-repositories" (
226260 set " BUILD_FULL_REPOSITORIES = yes"
227261 ) else if " %~1 " == " --build-use-local-src" (
228262 set " BUILD_USE_LOCAL_SRC = yes"
263+ ) else if " %~1 " == " --build-skip-tests" (
264+ set " BUILD_SKIP_TESTS = yes"
229265 ) else if " %~1 " == " --verbose" (
230266 set " DISPLAY_VERBOSE = yes"
231267 ) else if " %~1 " == " -v" (
@@ -234,6 +270,12 @@ if "!libbitcoin_server_TAG!" == "" (
234270 set " SHOW_HELP = yes"
235271 ) else if " %~1 " == " -h" (
236272 set " SHOW_HELP = yes"
273+ ) else (
274+ if " !UNHANDLED_ARGS! " == " " (
275+ set " UNHANDLED_ARGS = %1 "
276+ ) else (
277+ set " UNHANDLED_ARGS = !UNHANDLED_ARGS! %1 "
278+ )
237279 )
238280
239281 shift
@@ -289,10 +331,23 @@ if "!libbitcoin_server_TAG!" == "" (
289331 set " RELATIVE_PATH = %~2 "
290332 set " TARGET = %~3 "
291333
292- if " %TARGET% " == " " (
293- set " TARGET_ARG = "
334+ if not " %TARGET% " == " " (
335+ if not " !BUILD_MODE! " == " " (
336+ set " TARGET_ARG = /target:%TARGET% :!BUILD_MODE! "
337+ ) else (
338+ set " TARGET_ARG = /target:%TARGET% "
339+ )
294340 ) else (
295- set " TARGET_ARG = /target:%TARGET% :Rebuild"
341+ if not " !BUILD_MODE! " == " " (
342+ set " TARGET_ARG = /target:!BUILD_MODE! "
343+ )
344+ )
345+
346+ set " SYMBOLS_ARG = "
347+ if " !BUILD_SYMBOLS! " == " disabled" (
348+ set " SYMBOLS_ARG = /p:LinkerOptions=/PDBSTRIPPED "
349+ ) else if " !BUILD_SYMBOLS! " == " public-only" (
350+ set " SYMBOLS_ARG = /p:DebugSymbols=false "
296351 )
297352
298353 call :push_directory " !BUILD_SRC_DIR! \%PROJECT% \%RELATIVE_PATH% \!BUILD_VERSION! "
@@ -305,10 +360,10 @@ if "!libbitcoin_server_TAG!" == "" (
305360 exit /b %ERRORLEVEL%
306361 )
307362
308- !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
363+ !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!
309364
310365 if %ERRORLEVEL% neq 0 (
311- 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"
366+ 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! "
312367 call :pop_directory
313368 exit /b 1
314369 )
@@ -335,6 +390,8 @@ if "!libbitcoin_server_TAG!" == "" (
335390 call :msg " BUILD_SRC_DIR : !BUILD_SRC_DIR! "
336391 call :msg " BUILD_FULL_REPOSITORIES : !BUILD_FULL_REPOSITORIES! "
337392 call :msg " BUILD_USE_LOCAL_SRC : !BUILD_USE_LOCAL_SRC! "
393+ call :msg " BUILD_MODE : !BUILD_MODE! "
394+ call :msg " BUILD_SYMBOLS : !BUILD_SYMBOLS! "
338395 call :msg " DISPLAY_VERBOSE : !DISPLAY_VERBOSE! "
339396 call :msg " SHOW_HELP : !SHOW_HELP! "
340397 exit /b %ERRORLEVEL%
@@ -368,6 +425,10 @@ if "!libbitcoin_server_TAG!" == "" (
368425 call :msg " --build-src-dir path Location of sources."
369426 call :msg " --build-full-repositories Sync full github repositories."
370427 call :msg " --build-use-local-src Use existing sources in build-src-dir path."
428+ call :msg " --build-mode mode Determines action on target."
429+ call :msg " Default: Rebuild"
430+ call :msg " --build-symbols mode Determines treatment of symbols."
431+ call :msg " Values: default, disabled, public-only"
371432 call :msg " --verbose Display verbose script output."
372433 call :msg " --help, -h Display usage, overriding script execution."
373434 exit /b %ERRORLEVEL%
0 commit comments