-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
36 lines (30 loc) · 1.01 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
:: simple build script for now
:: should probably setup for cmake later
@setlocal
@echo off
set DEBUG=0
if /I "%~1"=="debug" set DEBUG=1
:: common options
set CLOPTS=/nologo /c /IC:\apps\include /W4 /D CFILE_EXPORTS
set LINKOPTS=/NOLOGO /INCREMENTAL:NO /LIBPATH:C:\apps\lib /MANIFEST:EMBED
set LIBOPTS=/NOLOGO /LIBPATH:C:\apps\lib
::set LINKLIBS=zlibstatic.lib bz2_static.lib liblzma.lib zstd_static.lib
:: debug opts
if %DEBUG%==1 (
echo Building in debug mode
set CLOPTS=%CLOPTS% /Zi /Od /MDd
set LINKOPTS=%LINKOPTS% /DEBUG
set LINKLIBS=zlibstaticd.lib
set LINKLIBS=%LINKLIBS% "C:\Users\Brian\Documents\programming\bzip2\build_debug\bz2_static.lib"
set LINKLIBS=%LINKLIBS% liblzma.lib zstd.lib
) else (
echo Building in release mode
set CLOPTS=%CLOPTS% /O2 /MD
set LINKLIBS=zlibstatic.lib bz2_static.lib liblzma.lib zstd.lib
)
:: build
@echo on
cl %CLOPTS% cfile.c test_cfile.c
link %LINKOPTS% /DLL cfile.obj %LINKLIBS%
::lib %LIBOPTS% cfile.obj %LINKLIBS%
link %LINKOPTS% test_cfile.obj cfile.obj %LINKLIBS%