Initial commit
Basic SDL3 window Build script for windows Added SDL3 submodule Added stb submodule
This commit is contained in:
62
windows.bat
Normal file
62
windows.bat
Normal file
@@ -0,0 +1,62 @@
|
||||
@ECHO OFF
|
||||
SETLOCAL
|
||||
|
||||
PUSHD "%~dp0" > NUL
|
||||
|
||||
IF NOT EXIST "build" ( MKDIR "build" )
|
||||
|
||||
PUSHD "build"
|
||||
|
||||
SET deps=0
|
||||
SET release=0
|
||||
|
||||
FOR %%A in (%*) DO (
|
||||
SET %%A=1
|
||||
)
|
||||
|
||||
IF NOT EXIST "deps\SDL3" (
|
||||
SET deps=1
|
||||
)
|
||||
|
||||
IF %deps% equ 1 (
|
||||
ECHO [Building dependencies]
|
||||
|
||||
RMDIR /Q /S "deps"
|
||||
|
||||
RMDIR /Q /S "..\thirdparty\SDL3\build" 2> NUL
|
||||
MKDIR "..\thirdparty\SDL3\build"
|
||||
|
||||
PUSHD "..\thirdparty\SDL3\build"
|
||||
|
||||
cmake -DCMAKE_INSTALL_PREFIX="..\..\..\build\deps\SDL3" ..
|
||||
|
||||
IF %release% equ 1 (
|
||||
msbuild -p:Configuration=Release -p:Platform=x64 SDL3.sln
|
||||
msbuild -p:Configuration=Release -p:Platform=x64 INSTALL.vcxproj
|
||||
) ELSE (
|
||||
msbuild -p:Configuration=Debug -p:Platform=x64 SDL3.sln
|
||||
msbuild -p:Configuration=Debug -p:Platform=x64 INSTALL.vcxproj
|
||||
)
|
||||
|
||||
POPD
|
||||
|
||||
COPY "deps\SDL3\bin\SDL3.dll" "."
|
||||
|
||||
MKDIR "deps\stb"
|
||||
COPY "..\thirdparty\stb\*.h" "deps\stb" > NUL
|
||||
)
|
||||
|
||||
ECHO [Building source]
|
||||
|
||||
SET COMPILER_OPTS=-nologo -W4 -I"deps\SDL3\include" -I"deps\stb"
|
||||
SET LINKER_OPTS=-LIBPATH:"deps\SDL3\lib" SDL3.lib
|
||||
|
||||
IF %release% equ 1 (
|
||||
ECHO [Release build]
|
||||
cl -O2 -WX %COMPILER_OPTS% "..\code\first.c" -link %LINKER_OPTS%
|
||||
) ELSE (
|
||||
ECHO [Debug build]
|
||||
cl -Od -Zi %COMPILER_OPTS% "..\code\first.c" -link %LINKER_OPTS%
|
||||
)
|
||||
|
||||
POPD
|
||||
Reference in New Issue
Block a user