add option to avoid regenerating build files

This commit is contained in:
a
2025-07-25 00:28:24 +03:00
parent 1d2e40f29b
commit e1fec109f6
2 changed files with 17 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ function help_page () {
echo "./$(basename "$0") [switches]"
echo "switches:"
echo " --deps: rebuild third-party dependencies"
echo " --nogen: don't regenerate build files"
echo " --help: show this page"
}
@@ -12,10 +13,13 @@ build_threads="$(( $(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 0) * 70 / 100
[[ $build_threads -lt 2 ]] && build_threads=2
BUILD_DEPS=0
GEN_PROJECT=1
for (( i=1; i<=$#; ++i )); do
arg="${!i}"
if [[ "$arg" = "--deps" ]]; then
BUILD_DEPS=1
elif [[ "$arg" = "--nogen" ]]; then
GEN_PROJECT=0
elif [[ "$arg" = "--help" ]]; then
help_page
exit 0
@@ -40,9 +44,11 @@ if [[ $BUILD_DEPS = 1 ]]; then
}
fi
if [[ $GEN_PROJECT = 1 ]]; then
"$premake_exe" --genproto --os=linux gmake2 || {
exit 1;
}
fi
pushd ./"build/project/gmake2/linux"

View File

@@ -12,12 +12,15 @@ if defined NUMBER_OF_PROCESSORS (
)
set /a "BUILD_DEPS=0"
set /a "GEN_PROJECT=1"
:args_loop
if "%~1" equ "" (
goto :args_loop_end
) else if "%~1" equ "--deps" (
set /a "BUILD_DEPS=1"
) else if "%~1" equ "--nogen" (
set /a "GEN_PROJECT=0"
) else if "%~1" equ "--help" (
goto :help_page
) else (
@@ -63,9 +66,13 @@ set /a "BUILD_DEPS=0"
)
:: create .sln
if %GEN_PROJECT% equ 0 (
goto :gen_project_end
)
call "%PREMAKE_EXE%" --file="premake5.lua" --genproto --dosstub --winrsrc --winsign --os=windows vs2022 || (
goto :end_script_with_err
)
:gen_project_end
:: check .sln
set "SLN_FILE=build\project\vs2022\win\gbe.sln"
@@ -108,5 +115,6 @@ set /a "BUILD_DEPS=0"
echo:"%~nx0" [switches]
echo:switches:
echo: --deps: rebuild third-party dependencies
echo: --nogen: don't regenerate build files
echo: --help: show this page
goto :end_script