Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
fix: typo and err handle in build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Nambers committed Mar 29, 2023
1 parent 462f88c commit d3aa35a
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions scripts/WIN/cppBuilds.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ echo --- start cppBuilds.bat ---
echo --- prebuild ---
set workDir=%__CD__%
echo working directory: %workDir%
IF "$1"=="clean" (
IF "%1"=="clean" (
echo --- clean build directory ---
IF exist %workDir%cpp\build\ (
rmdir /s /q %workDir%cpp\build
) ELSE (
echo warning: build directory not found
)
cd %workDir%
exit /b 0
)

Expand All @@ -28,24 +29,25 @@ IF "%2"=="mingw" (
)

IF errorlevel 1 (
echo Error: cmake failed
echo Error: cmake initation failed
cd %workDir%
exit /b 1
)

IF "%1"=="multi" (
set targetName="MiraiCP_multi"
set targetName=MiraiCP_multi
goto build
)
IF "%1"=="single" (
set targetName="MiraiCP_single"
set targetName=MiraiCP_single
goto build
)
IF "%1"=="libLoader" (
set targetName="Loader"
set targetName=Loader
goto build
)
IF "%1"=="libLoaderNative" (
set targetName="LoaderNative"
set targetName=LoaderNative
goto build
)

Expand All @@ -60,6 +62,12 @@ cd %workDir%cpp
cmake --build build --target %targetName% --config Release
@echo off

IF errorlevel 1 (
echo Error: %targetName% build failed
cd %workDir%
exit /b 1
)

:end
echo --- end cppBuilds.bat ---
:: restore working directory
Expand Down

0 comments on commit d3aa35a

Please sign in to comment.