made build system more agnostic to the projet it builds
This commit is contained in:
+19
-5
@@ -27,6 +27,11 @@ set CONFIG_SPECIFIED=0
|
||||
|
||||
:parse_args
|
||||
if "%~1"=="" goto check_defaults
|
||||
if /i "%~1"=="gen_vs" (
|
||||
set COMMAND_GEN_VS=1
|
||||
set GEN_VS_PLAN=%~2
|
||||
goto do_compile_build_tool
|
||||
)
|
||||
if /i "%~1"=="debug" set CONFIG_DEBUG=1& set CONFIG_SPECIFIED=1
|
||||
if /i "%~1"=="release" set CONFIG_RELEASE=1& set CONFIG_SPECIFIED=1
|
||||
if /i "%~1"=="profile" set CONFIG_PROFILE=1& set CONFIG_SPECIFIED=1
|
||||
@@ -41,7 +46,7 @@ goto parse_args
|
||||
if !CONFIG_SPECIFIED! equ 0 set CONFIG_DEBUG=1& if !TARGET_SPECIFIED! equ 0 set CONFIG_RELEASE=1& set CONFIG_PROFILE=1
|
||||
if !TARGET_SPECIFIED! equ 0 set TARGET_JULIET=1& set TARGET_GAME=1& set TARGET_ROMEO=1& set TARGET_SHADER=1
|
||||
|
||||
:start_build
|
||||
:do_compile_build_tool
|
||||
if not exist "%FBUILD%" (
|
||||
echo [BUILD FAILED] Could not find %FBUILD%.
|
||||
exit /b 1
|
||||
@@ -60,7 +65,7 @@ if !ERRORLEVEL! neq 0 (
|
||||
)
|
||||
|
||||
:: Check if build.exe needs to be compiled (missing, version changed, or source changed)
|
||||
set BUILD_TOOL_VER=4
|
||||
set BUILD_TOOL_VER=11
|
||||
set NEED_RECOMPILE_BUILD_TOOL=0
|
||||
if not exist "%BUILD_TOOL%" (
|
||||
set NEED_RECOMPILE_BUILD_TOOL=1
|
||||
@@ -109,6 +114,12 @@ if !NEED_RECOMPILE_BUILD_TOOL! equ 1 (
|
||||
for %%I in ("%BUILD_SRC%") do (echo %%~tI)>"Intermediate\build_tool.stamp"
|
||||
)
|
||||
|
||||
if "!COMMAND_GEN_VS!"=="1" (
|
||||
echo [BUILD] Generating Visual Studio Projects and Solutions...
|
||||
"%BUILD_TOOL%" gen_vs "!GEN_VS_PLAN!"
|
||||
exit /b !ERRORLEVEL!
|
||||
)
|
||||
|
||||
echo [BUILD] Generating Build Plan...
|
||||
set PLAN_FILE=Intermediate\build_plan.txt
|
||||
if exist "!PLAN_FILE!" del /f /q "!PLAN_FILE!"
|
||||
@@ -183,10 +194,13 @@ echo COMMAND %COMPILER% %COMPILER_FLAGS% /DIMGUI_API=__declspec^(dllexport^) /DJ
|
||||
|
||||
:: --- Game.dll ---
|
||||
if !BUILD_GAME_DLL! equ 1 (
|
||||
echo STEP Building Game.dll [!CFG!]>>"!PLAN_FILE!"
|
||||
echo OUTPUT bin\x64-!CFG!\Game.dll>>"!PLAN_FILE!"
|
||||
set "GAME_DLL_NAME=Game"
|
||||
if defined GAME_BUILD_ID set "GAME_DLL_NAME=Game-!GAME_BUILD_ID!"
|
||||
|
||||
echo STEP Building !GAME_DLL_NAME!.dll [!CFG!]>>"!PLAN_FILE!"
|
||||
echo OUTPUT bin\x64-!CFG!\!GAME_DLL_NAME!.dll>>"!PLAN_FILE!"
|
||||
echo DEPENDS Game^|Juliet^|External\imgui>>"!PLAN_FILE!"
|
||||
echo COMMAND %COMPILER% %COMPILER_FLAGS% /DIMGUI_API=__declspec^(dllimport^) /DJULIET_EXPORT /LD /Fe"bin\x64-!CFG!\Game.dll" Intermediate\Game\*.cpp /link %COMMON_LIBS% bin\x64-!CFG!\Juliet.lib /INCREMENTAL /ILK:Intermediate\x64-!CFG!\Game.ilk /PDB:Intermediate\x64-!CFG!\Game.pdb>>"!PLAN_FILE!"
|
||||
echo COMMAND %COMPILER% %COMPILER_FLAGS% /DIMGUI_API=__declspec^(dllimport^) /DJULIET_EXPORT /LD /Fe"bin\x64-!CFG!\!GAME_DLL_NAME!.dll" Intermediate\Game\*.cpp /link %COMMON_LIBS% bin\x64-!CFG!\Juliet.lib /INCREMENTAL /ILK:Intermediate\x64-!CFG!\!GAME_DLL_NAME!.ilk /PDB:Intermediate\x64-!CFG!\!GAME_DLL_NAME!.pdb>>"!PLAN_FILE!"
|
||||
)
|
||||
|
||||
:: --- JulietApp.exe ---
|
||||
|
||||
Reference in New Issue
Block a user