86 lines
1.8 KiB
Batchfile
86 lines
1.8 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
:: ------------------------------------------------------------------------------
|
|
:: FastBuild Unity Build Script (Located in misc/)
|
|
:: ------------------------------------------------------------------------------
|
|
|
|
set SCRIPT_DIR=%~dp0
|
|
cd /d "%SCRIPT_DIR%.."
|
|
|
|
set FBUILD=misc\fbuild.exe
|
|
set CONFIG=Debug
|
|
set TARGETS=
|
|
|
|
if not exist "%FBUILD%" (
|
|
echo [ERROR] Could not find %FBUILD%. Please check workspace setup.
|
|
exit /b 1
|
|
)
|
|
|
|
:parse_args
|
|
if "%~1"=="" goto run_build
|
|
|
|
if /i "%~1"=="debug" (
|
|
set CONFIG=Debug
|
|
shift
|
|
goto parse_args
|
|
)
|
|
|
|
if /i "%~1"=="release" (
|
|
set CONFIG=Release
|
|
shift
|
|
goto parse_args
|
|
)
|
|
|
|
if /i "%~1"=="profile" (
|
|
set CONFIG=Profile
|
|
shift
|
|
goto parse_args
|
|
)
|
|
|
|
if /i "%~1"=="clean" (
|
|
echo Cleaning build artifacts...
|
|
"%FBUILD%" -clean
|
|
exit /b %ERRORLEVEL%
|
|
)
|
|
|
|
if /i "%~1"=="julietapp" (
|
|
set TARGETS=!TARGETS! JulietApp-x64-%CONFIG%
|
|
shift
|
|
goto parse_args
|
|
)
|
|
|
|
if /i "%~1"=="romeo" (
|
|
set TARGETS=!TARGETS! Romeo-x64-%CONFIG%
|
|
shift
|
|
goto parse_args
|
|
)
|
|
|
|
if /i "%~1"=="shader" (
|
|
set TARGETS=!TARGETS! JulietShaderCompiler-x64Clang-%CONFIG%
|
|
shift
|
|
goto parse_args
|
|
)
|
|
|
|
if /i "%~1"=="unity-only" (
|
|
echo Generating Unity files only...
|
|
"%FBUILD%" JulietApp-Unity-x64-%CONFIG% Romeo-Unity-x64-%CONFIG% JulietShaderCompiler-Unity-x64Clang-%CONFIG%
|
|
exit /b %ERRORLEVEL%
|
|
)
|
|
|
|
:: If target name passed explicitly
|
|
set TARGETS=!TARGETS! %~1
|
|
shift
|
|
goto parse_args
|
|
|
|
:run_build
|
|
if "!TARGETS!"=="" (
|
|
echo Building default targets (JulietApp, Romeo, JulietShaderCompiler) [%CONFIG%]...
|
|
set TARGETS=JulietApp-x64-%CONFIG% Romeo-x64-%CONFIG% JulietShaderCompiler-x64Clang-%CONFIG%
|
|
) else (
|
|
echo Building targets: !TARGETS! [%CONFIG%]...
|
|
)
|
|
|
|
"%FBUILD%" -summary -showcmds !TARGETS!
|
|
exit /b %ERRORLEVEL%
|