-
Notifications
You must be signed in to change notification settings - Fork 47
/
build.bat
37 lines (30 loc) · 1.13 KB
/
build.bat
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
@echo off
setlocal enabledelayedexpansion
IF "%DC%"=="" SET DC="dmd"
set DFLAGS=-g
set CORE=
set STD=
set STDD=
set STDXALLOCATOR=
set STDXALLOCATORBLOCKS=
set OBIN=bin\dfmt
:: git might not be installed, so we provide 0.0.0 as a fallback or use
:: the existing githash file if existent
if not exist "bin" mkdir bin
git describe --tags > bin\githash_.txt
for /f %%i in ("bin\githash_.txt") do set githashsize=%%~zi
if %githashsize% == 0 (
if not exist "bin\githash.txt" (
echo v0.0.0 > bin\githash.txt
)
) else (
move /y bin\githash_.txt bin\githash.txt
)
for %%x in (src\dfmt\*.d) do set CORE=!CORE! %%x
for %%x in (libdparse\src\std\experimental\*.d) do set STD=!STD! %%x
for %%x in (libdparse\src\dparse\*.d) do set STDD=!STDD! %%x
for %%x in (stdx-allocator\source\stdx\allocator\*.d) do set STDXALLOCATOR=!STDXALLOCATOR! %%x
for %%x in (stdx-allocator\source\stdx\allocator\building_blocks\*.d) do set STDXALLOCATORBLOCKS=!STDXALLOCATORBLOCKS! %%x
@echo on
%DC% %CORE% %STD% %STDD% %STDE% %STDXALLOCATOR% %STDXALLOCATORBLOCKS% -I"stdx-allocator\source" -I"libdparse\src" -Jbin %DFLAGS% -of%OBIN%.exe
if exist %OBIN%.obj del %OBIN%.obj