-
Notifications
You must be signed in to change notification settings - Fork 78
/
build-libffi.bat
29 lines (21 loc) · 1.62 KB
/
build-libffi.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
echo build-libffi.bat: generating libffi-x86
SET ROOT_DIR=%~dp0
set LIBFFI_ROOT=%ROOT_DIR%\third-party\libffi
set LIBFFI_BUILD=%LIBFFI_ROOT%\build
if exist "%LIBFFI_BUILD%" rmdir /q /s "%LIBFFI_BUILD%"
if exist "%LIBFFI_ROOT%\win32\vs16_x86\Debug" rmdir /q /s "%LIBFFI_ROOT%\win32\vs16_x86\Debug"
if exist "%LIBFFI_ROOT%\win32\vs16_x86\Release" rmdir /q /s "%LIBFFI_ROOT%\win32\vs16_x86\Release"
if exist "%LIBFFI_ROOT%\win32\vs16_x64\x64\Debug" rmdir /q /s "%LIBFFI_ROOT%\win32\vs16_x64\x64\Debug"
if exist "%LIBFFI_ROOT%\win32\vs16_x64\x64\Release" rmdir /q /s "%LIBFFI_ROOT%\win32\vs16_x64\x64\Release"
mkdir "%LIBFFI_BUILD%"
msbuild "%LIBFFI_ROOT%\win32\vs16_x86\libffi-msvc.sln" /p:Configuration=Debug /p:Platform=Win32
msbuild "%LIBFFI_ROOT%\win32\vs16_x86\libffi-msvc.sln" /p:Configuration=Release /p:Platform=Win32
msbuild "%LIBFFI_ROOT%\win32\vs16_x64\libffi-msvc.sln" /p:Configuration=Debug /p:Platform=x64
msbuild "%LIBFFI_ROOT%\win32\vs16_x64\libffi-msvc.sln" /p:Configuration=Release /p:Platform=x64
copy "%LIBFFI_ROOT%\include\ffi.h" "%LIBFFI_BUILD%"
copy "%LIBFFI_ROOT%\src\x86\ffitarget.h" "%LIBFFI_BUILD%"
powershell -Command "(gc -Encoding ASCII '%LIBFFI_BUILD%\ffi.h') -replace '#include <ffitarget.h>', '#include \"ffitarget.h\"' | Out-File -Encoding ASCII '%LIBFFI_BUILD%\ffi.h'"
copy "%LIBFFI_ROOT%\win32\vs16_x86\Debug\libffi.lib" "%LIBFFI_BUILD%\libffi32d.lib"
copy "%LIBFFI_ROOT%\win32\vs16_x86\Release\libffi.lib" "%LIBFFI_BUILD%\libffi32.lib"
copy "%LIBFFI_ROOT%\win32\vs16_x64\x64\Debug\libffi.lib" "%LIBFFI_BUILD%\libffi64d.lib"
copy "%LIBFFI_ROOT%\win32\vs16_x64\x64\Release\libffi.lib" "%LIBFFI_BUILD%\libffi64.lib"