Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the batch file for windows is based off your system --proposed fix #6

Open
JeffChilders opened this issue Nov 26, 2018 · 0 comments
Open

Comments

@JeffChilders
Copy link

the following wont fix everyone but it is a bit more idiot proof for windows. I cant remember C much... its been 30 years after all but the batch file builds still suck but this should help. The only thing better would be creating a full installer imo

@echo off
cls

del dark.exe
del *.pdb

REM GO FROM HIGHEST TO LOWET TO GET THE CL VARS IE RUN THE LASTEST VCVARSALL.BAT
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2018\Community\VC\Auxiliary\Build\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 2018"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2018\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 2017"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 14.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 13.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 13.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 13.0\VC\vcvarsall.bat" x86
goto FINAL
)
if exist "%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" (
echo "FOUND: Microsoft Visual Studio 12.0"
call "%PROGRAMFILES(X86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
goto FINAL
)

:FINAL

REM the the current working directory
SET CurrentDir=%cd%

SET INCLUDE_DIRS=/I"%CurrentDir%\sdl2\include"
SET OPTS=/c
SET DEBUG=/DDEBUG /Zi /Fddark.pdb

SET LIB_DIRS=/LIBPATH:"%CurrentDir%\sdl2\lib\x86"
SET LIBS=SDL2.lib SDL2main.lib
SET LINKER_OPTS=/SUBSYSTEM:console /DEBUG

cl %INCLUDE_DIRS% %OPTS% %DEBUG% dark.c

link %LIB_DIRS% %LINKER_OPTS% dark.obj %LIBS%

del *.obj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant