forked from simple2d/simple2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple2d.cmd
54 lines (43 loc) · 1.2 KB
/
simple2d.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
:: Simple 2D Command-Line Utility for Windows
@echo off
:: The installed version
set S2D_VERSION=1.1.0
:: Set flags used to build Simple 2D apps
set S2D_FLAGS=/I %LOCALAPPDATA%\simple2d /link /LIBPATH %LOCALAPPDATA%\simple2d\simple2d.lib /SUBSYSTEM:CONSOLE
:: Compile a C file
if "%~1"=="build" (
if "%~2"=="" (
echo Error: no input files
exit /b 0
)
cl %2 /Fo%~np2 /Fe%~np2 %S2D_FLAGS%
del %~np2.obj
exit /b 0
)
:: Output includes and libraries
if "%~1"=="--libs" (
echo %S2D_FLAGS%
exit /b 0
)
:: Print current version
if "%~1"=="-v" goto :print_version
if "%~1"=="--version" goto :print_version
:: If no matches, print usage message
call :print_usage
exit /b 0
:: End main script, start functions
:print_version
echo %S2D_VERSION%
exit /b 0
:print_usage
echo Simple 2D is a simple, open-source 2D graphics engine for everyone.
echo.
echo Usage: simple2d [--libs] [-v^|--version]
echo ^<command^> ^<options^>
echo.
echo Summary of commands and options:
echo build Compiles a Simple 2D app provided a C/C++ source file
echo --libs Outputs libraries needed to compile Simple 2D apps
echo -v^|--version Prints the installed version
echo.
exit /b 0