summaryrefslogtreecommitdiffstats
path: root/contrib/build-scripts/build-arabica-windows.bat
blob: 2e8647c12db51ee1461dd3982d6b35302f48ccf9 (plain)
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
@ECHO off

set ME=%0
set DIR=%~dp0

if "%VSINSTALLDIR%" == "" (
	echo.
	echo %VSINSTALLDIR is not defined, run from within Visual Studio Command Prompt.
	echo.
	goto :DONE
)

echo %LIB% |find "LIB\amd64;" > nul
if %errorlevel% == 0 (
	set DEST_DIR="%DIR%..\prebuilt\windows-x86_64/msvc"
	set CPU_ARCH=x86_64
	goto :ARCH_FOUND
)

echo %LIB% |find "LIB;" > nul
if %errorlevel% == 0 (
	set DEST_DIR="%DIR%..\prebuilt\windows-x86/msvc"
	set CPU_ARCH=x86
	goto :ARCH_FOUND
)

:ARCH_FOUND

if "%DEST_DIR%" == "" (
	echo.
	echo Unknown Platform %Platform%.
	echo.
	goto :DONE
)

IF NOT EXIST "src\arabica.cpp" (
	echo.
	echo Cannot find src\arabica.cpp
	echo Run script from within arabica directory:
	echo arabica $ ..\%ME%
	echo.
	goto :DONE
)

devenv /upgrade vs10/Arabica.sln

if "%CPU_ARCH%" == "x86_64" (
	devenv /build "debug|x64" vs10/Arabica.sln /project ArabicaLib
	devenv /build "release|x64" vs10/Arabica.sln /project ArabicaLib
)

if "%CPU_ARCH%" == "x86" (
	devenv /build "debug|Win32" vs10/Arabica.sln /project ArabicaLib
	devenv /build "release|Win32" vs10/Arabica.sln /project ArabicaLib
)

copy lib\Arabica-debug.lib %DEST_DIR%\lib\Arabica_d.lib
copy lib\Arabica.lib %DEST_DIR%\lib\Arabica.lib
mkdir %DEST_DIR%\include\arabica
xcopy include\*.hpp %DEST_DIR%\include\arabica /s /e


:DONE
pause