forked from mockingbot/mb_colorpicker_desktop_native
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
75 lines (55 loc) · 2.26 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@echo off
setlocal
set PRJ_DIR=%cd%
set DEFAULT_PATH=C:\Windows\system32;C:\Windows;
@rem VS2017 Command Promot have need this
set VSCMD_START_DIR=%PRJ_DIR%
set VS2017_INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
echo %VS2017_INSTALLDIR%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: The main function ::
:: ::
call :CLEAN_ENV
call "%VS2017_INSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat"
echo Build X64 Static MT
set DST_DIR=%PRJ_DIR%\_dst\Windows\x64
set BUILD_DIR=%PRJ_DIR%\_build\Windows\x64
call :BUILD
call :CLEAN_ENV
call "%VS2017_INSTALLDIR%\VC\Auxiliary\Build\vcvars32.bat"
echo Build X32 Static MT
set DST_DIR=%PRJ_DIR%\_dst\Windows\x32
set BUILD_DIR=%PRJ_DIR%\_build\Windows\x32
call :BUILD
goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: The clean env function ::
:: ::
:CLEAN_ENV
set VSINSTALLDIR=
set INCLUDE=
set LIB=
set LIBPATH=
set PATH=%DEFAULT_PATH%
goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: The build function ::
:: ::
:BUILD
mkdir %DST_DIR% 2> nul
mkdir %BUILD_DIR% 2> nul
echo %CD%
set SRC_DIR=%PRJ_DIR%\src\Windows
set RC_FLAG=/nologo /i%PRJ_DIR%\res
set CL_FLAG=/nologo /DRELEASE /DUNICODE /MT /EHsc /Ox /c
set LINK_FLAG=/NOLOGO user32.lib gdi32.lib ole32.lib
set LINK_LIBS=gdiplus.lib magnification.lib
pushd %BUILD_DIR%
cl %CL_FLAG% %SRC_DIR%\ColorPicker.cxx
rc %RC_FLAG% /foResource.res %SRC_DIR%\Resource.rc
link %LINK_FLAG% %LINK_LIBS% *.res *.obj /OUT:%DST_DIR%\ColorPicker.exe
popd
goto :EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::