Commit 12742b8c authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Ming Rui Zhang

win32: add python build script

Change-Id: I464d2f29173d2bcfdf6ddea5e26ed9e0192e98ae
parent f4314dbe
:: Ring - native Windows fetch and build
@echo off
@setlocal
if "%1" == "/?" goto Usage
if "%~1" == "" goto Usage
set doFetch=N
set doBuildContrib=N
set doBuildDaemon=N
set targetContrib=""
set SCRIPTNAME=%~nx0
if "%1"=="fetch" (
set doFetch=Y
) else if "%1"=="contrib" (
set doBuildContrib=Y
) else if "%1"=="daemon" (
set doBuildDaemon=Y
) else (
goto Usage
)
set BUILD.x86=N
set BUILD.x64=Y
set BUILD.uwp=N
set BUILD.win32=Y
shift
:ParseArgs
if "%1" == "" goto FinishedArgs
if /I "%1"=="x86" (
set BUILD.x86=Y
) else if /I "%1"=="x64" (
set BUILD.x64=Y
) else if /I "%1"=="uwp" (
set BUILD.uwp=Y
) else if /I "%1"=="win32" (
set BUILD.win32=Y
) else if /I "%1" neq "" (
if "%doBuildContrib%" neq "N" (
set targetContrib=%1
) else if "%doFetch%" neq "N" (
set targetContrib=%1
)
) else (
goto Usage
)
shift
goto ParseArgs
:FinishedArgs
set CONTRIB_DIR=%~dp0../contrib
set platform=N
set arch=N
if "%BUILD.x86%"=="Y" (
set arch=x86
) else if "%BUILD.x64%"=="Y" (
set arch=x64
)
if "%BUILD.uwp%"=="Y" (
set platform=uwp
if "%arch%"=="x86" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib /p:Platform=Win32 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
) else if "%arch%"=="x64" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib /p:Platform=x64 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
)
) else if "%BUILD.win32%"=="Y" (
set platform=win32
if "%arch%"=="x86" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib_win32 /p:Platform=Win32 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
) else if "%arch%"=="x64" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib_win32 /p:Platform=x64 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
)
)
if "%arch%" neq "N" (
if "%platform%" neq "N" (
if "%doFetch%" neq "N" (
call %CONTRIB_DIR%\src\fetch_all.bat %platform% %arch% %targetContrib%
) else if "%doBuildContrib%" neq "N" (
call %CONTRIB_DIR%\build_all.bat %platform% %arch% %targetContrib%
) else if "%doBuildDaemon%" neq "N" (
goto buildDaemon
)
goto :eof
)
)
goto Usage
:buildDaemon
@setlocal
set VSInstallerFolder="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
if %PROCESSOR_ARCHITECTURE%==x86 set VSInstallerFolder="%ProgramFiles%\Microsoft Visual Studio\Installer"
pushd %VSInstallerFolder%
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set VSLATESTDIR=%%i
)
popd
echo VS Installation folder: %VSLATESTDIR%
if not exist "%VSLATESTDIR%\VC\Auxiliary\Build\vcvarsall.bat" (
echo:
echo VSInstallDir not found or not installed correctly.
goto cleanup
)
if %PROCESSOR_ARCHITECTURE%==x86 (
if "%platform%"=="uwp" (
set Comp_x86=x86 uwp 10.0.15063.0
set Comp_x64=x86_amd64 uwp 10.0.15063.0
) else (
set Comp_x86=x86 10.0.15063.0
set Comp_x64=x86_amd64 10.0.15063.0
)
) else (
if "%platform%"=="uwp" (
set Comp_x86=amd64_x86 uwp 10.0.15063.0
set Comp_x64=amd64 uwp 10.0.15063.0
) else (
set Comp_x86=amd64_x86 10.0.15063.0
set Comp_x64=amd64 10.0.15063.0
)
)
set path=%path:"=%
if "%arch%"=="x86" (
call "%VSLATESTDIR%"\\VC\\Auxiliary\\Build\\vcvarsall.bat %Comp_x86%
) else if "%arch%"=="x64" (
call "%VSLATESTDIR%"\\VC\\Auxiliary\\Build\\vcvarsall.bat %Comp_x64%
)
::build the daemon
echo "building daemon..."
msbuild ring-daemon.vcxproj %DAEMON_MSBUILD_ARGS%
goto :eof
@endlocal
:Usage
echo:
echo The correct usage is:
echo:
echo %0 [action] [target platform] [architecture]
echo:
echo where
echo:
echo [action] is: fetch ^| build
echo [target platform] is: uwp ^| win32
echo [architecture] is: x86 ^| x64
echo:
echo For example:
echo %SCRIPTNAME% fetch win32 x86 - fetch contrib for a win32/x86 build
echo %SCRIPTNAME% contrib uwp x64 - build uwp(win10)/x64 contrib
echo %SCRIPTNAME% daemon uwp x64 - build uwp(win10)/x64 daemon
echo:
goto :eof
@endlocal
\ No newline at end of file
{
"name": "daemon",
"deps": [
"asio",
"ffmpeg",
"natpmp",
"opendht",
"pjproject",
"portaudio",
"secp256k1",
"upnp",
"yaml-cpp"
],
"configuration": "ReleaseLib_win32",
"project_paths": ["ring-daemon.vcxproj"]
}
\ No newline at end of file
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ring-daemon", "ring-daemon.vcxproj", "{79F8DE42-595D-49D9-A66F-55244FD9DCC3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DebugLib_win32|x64 = DebugLib_win32|x64
DebugLib_win32|x86 = DebugLib_win32|x86
DebugLib|x64 = DebugLib|x64
DebugLib|x86 = DebugLib|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseLib_win32|x64 = ReleaseLib_win32|x64
ReleaseLib_win32|x86 = ReleaseLib_win32|x86
ReleaseLib|x64 = ReleaseLib|x64
ReleaseLib|x86 = ReleaseLib|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Debug|x64.ActiveCfg = Debug|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Debug|x64.Build.0 = Debug|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Debug|x86.ActiveCfg = Debug|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Debug|x86.Build.0 = Debug|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib_win32|x64.ActiveCfg = DebugLib_win32|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib_win32|x64.Build.0 = DebugLib_win32|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib_win32|x86.ActiveCfg = DebugLib_win32|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib_win32|x86.Build.0 = DebugLib_win32|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib|x64.ActiveCfg = DebugLib|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib|x64.Build.0 = DebugLib|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib|x86.ActiveCfg = DebugLib|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.DebugLib|x86.Build.0 = DebugLib|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Release|x64.ActiveCfg = Release|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Release|x64.Build.0 = Release|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Release|x86.ActiveCfg = Release|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.Release|x86.Build.0 = Release|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib_win32|x64.ActiveCfg = ReleaseLib_win32|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib_win32|x64.Build.0 = ReleaseLib_win32|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib_win32|x86.ActiveCfg = ReleaseLib_win32|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib_win32|x86.Build.0 = ReleaseLib_win32|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib|x64.ActiveCfg = ReleaseLib|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib|x64.Build.0 = ReleaseLib|x64
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib|x86.ActiveCfg = ReleaseLib|Win32
{79F8DE42-595D-49D9-A66F-55244FD9DCC3}.ReleaseLib|x86.Build.0 = ReleaseLib|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7505C3ED-E07A-48C4-BE60-8BD5A00CC85C}
EndGlobalSection
EndGlobal
......@@ -53,70 +53,70 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{79F8DE42-595D-49D9-A66F-55244FD9DCC3}</ProjectGuid>
<RootNamespace>ringdaemon</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugLib|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugLib_win32|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLib_win32|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugLib|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugLib_win32|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<WindowsAppContainer>false</WindowsAppContainer>
......@@ -124,14 +124,14 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLib|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLib_win32|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
......
This diff is collapsed.
@echo off
@setlocal EnableDelayedExpansion
set CONTRIB_DIR=%~dp0
set platform=win32
set arch=x64
if "%1"=="uwp" (
set platform=uwp
if "%2"=="x86" (
set arch=x86
goto arch_x86
) else if "%2"=="x64" (
set arch=x64
goto arch_x64
) else (
goto parameterError
)
) else if "%1"=="win32" (
if "%2"=="x86" (
set arch=x86
goto arch_x86
) else if "%2"=="x64" (
set arch=x64
goto arch_x64
) else (
goto parameterError
)
) else (
goto parameterError
)
:arch_x86
set MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=Release /p:Platform=Win32 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
if "%1"=="uwp" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib /p:Platform=Win32 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
goto uwpProjs
) else if "%1"=="win32" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib_win32 /p:Platform=Win32 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
goto win32Projs
)
:arch_x64
set MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=Release /p:Platform=x64 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
if "%1"=="uwp" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib /p:Platform=x64 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
goto uwpProjs
) else if "%1"=="win32" (
set DAEMON_MSBUILD_ARGS=/nologo /p:useenv=true /p:Configuration=ReleaseLib_win32 /p:Platform=x64 /verbosity:normal /maxcpucount:%NUMBER_OF_PROCESSORS%
goto win32Projs
)
:uwpProjs
set TOBUILD= ^
x264=build\x264\SMP\libx264.vcxproj, ^
opus=build\opus\SMP\libopus.vcxproj, ^
media-sdk=build\media-sdk\api\mfx_dispatch\windows\libmfx_vs2015.vcxproj, ^
ffmpeg=ffmpeg, ^
openssl=openssl, ^
asio=build\asio\asio\msvc\asio.vcxproj, ^
fmt=build\fmt\msvc\fmt.vcxproj, ^
http_parser=build\http_parser\http-parser.vcxproj, ^
jsoncpp=build\jsoncpp\makefiles\vs2017\lib_json.vcxproj, ^
argon2=build\argon2\vs2015\Argon2Ref\Argon2Ref.vcxproj, ^
gmp=build\gmp\SMP\libgmp.vcxproj, ^
iconv=build\iconv\SMP\libiconv.vcxproj, ^
zlib=build\zlib\SMP\libzlib.vcxproj, ^
nettle=build\nettle\SMP\libnettle.vcxproj, ^
hogweed=build\nettle\SMP\libhogweed.vcxproj, ^
gnutls=build\gnutls\SMP\libgnutls.vcxproj, ^
msgpack=build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
opendht=build\opendht\MSVC\opendht.vcxproj, ^
pjproject=pjproject, ^
pthreads=build\pthreads\MSVC\pthreads.vcxproj, ^
xml=build\pupnp\build\vs2017\ixml.vcxproj, ^
upnp=build\pupnp\build\vs2017\libupnp.vcxproj, ^
secp256k1=build\secp256k1\MSVC\secp256k1.vcxproj, ^
portaudio=build\portaudio\msvc\portaudio.vcxproj, ^
yaml-cpp=build\yaml-cpp\msvc\yaml-cpp.vcxproj, ^
goto startBuild
:win32Projs
set TOBUILD= ^
vpx=build\vpx\SMP\libvpx.vcxproj, ^
x264=build\x264\SMP\libx264.vcxproj, ^
opus=build\opus\SMP\libopus.vcxproj, ^
media-sdk=build\media-sdk\api\mfx_dispatch\windows\libmfx_vs2015.vcxproj, ^
ffmpeg=ffmpeg, ^
openssl=openssl, ^
asio=build\asio\asio\msvc\asio.vcxproj, ^
fmt=build\fmt\msvc\fmt.vcxproj, ^
http_parser=build\http_parser\http-parser.vcxproj, ^
jsoncpp=build\jsoncpp\makefiles\vs2017\lib_json.vcxproj, ^
argon2=build\argon2\vs2015\Argon2Ref\Argon2Ref.vcxproj, ^
iconv=build\iconv\SMP\libiconv.vcxproj, ^
zlib=build\zlib\SMP\libzlib.vcxproj, ^
gmp=build\gmp\SMP\libgmp.vcxproj, ^
nettle=build\nettle\SMP\libnettle.vcxproj, ^
hogweed=build\nettle\SMP\libhogweed.vcxproj, ^
gnutls=build\gnutls\SMP\libgnutls.vcxproj, ^
msgpack=build\msgpack-c\vs2017\msgpackc-static.vcxproj, ^
opendht=build\opendht\MSVC\opendht.vcxproj, ^
pjproject=pjproject, ^
pthreads=build\pthreads\MSVC\pthreads.vcxproj, ^
xml=build\pupnp\build\vs2017\ixml.vcxproj, ^
upnp=build\pupnp\build\vs2017\libupnp.vcxproj, ^
natpmp=build\natpmp\msvc\natpmp.vcxproj, ^
secp256k1=build\secp256k1\MSVC\secp256k1.vcxproj, ^
portaudio=build\portaudio\msvc\portaudio.vcxproj, ^
yaml-cpp=build\yaml-cpp\msvc\yaml-cpp.vcxproj
goto startBuild
:startBuild
set PJTOBUILD= ^
pjlib_util=build\pjproject\pjlib-util\build\pjlib_util.vcxproj, ^
pjmedia=build\pjproject\pjmedia\build\pjmedia.vcxproj, ^
pjmedia_codec=build\pjproject\pjmedia\build\pjmedia_codec.vcxproj, ^
pjlib=build\pjproject\pjlib\build\pjlib.vcxproj, ^
pjsip_core=build\pjproject\pjsip\build\pjsip_core.vcxproj, ^
pjsip_simple=build\pjproject\pjsip\build\pjsip_simple.vcxproj, ^
pjsua_lib=build\pjproject\pjsip\build\pjsua_lib.vcxproj, ^
pjsua2_lib=build\pjproject\pjsip\build\pjsua2_lib.vcxproj, ^
pjsip_ua=build\pjproject\pjsip\build\pjsip_ua.vcxproj, ^
pjnath=build\pjproject\pjnath\build\pjnath.vcxproj
@setlocal
set VSInstallerFolder="%ProgramFiles(x86)%\\Microsoft Visual Studio\\Installer"
if %PROCESSOR_ARCHITECTURE%==x86 set VSInstallerFolder="%ProgramFiles%\\Microsoft Visual Studio\\Installer"
pushd %VSInstallerFolder%
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do (
set VSLATESTDIR=%%i
)
popd
echo VS Installation folder: %VSLATESTDIR%
if not exist "%VSLATESTDIR%\\VC\\Auxiliary\\Build\\vcvarsall.bat" (
echo:
echo VSInstallDir not found or not installed correctly.
goto cleanup
)
if %PROCESSOR_ARCHITECTURE%==x86 (
if "%1"=="uwp" (
set Comp_x86=x86 uwp 10.0.15063.0
set Comp_x64=x86_amd64 uwp 10.0.15063.0
) else (
set Comp_x86=x86 10.0.15063.0
set Comp_x64=x86_amd64 10.0.15063.0
)
) else (
if "%1"=="uwp" (
set Comp_x86=amd64_x86 uwp 10.0.15063.0
set Comp_x64=amd64 uwp 10.0.15063.0
) else (
set Comp_x86=amd64_x86 10.0.15063.0
set Comp_x64=amd64 10.0.15063.0
)
)
set path=%path:"=%
if "%2"=="x86" (
call "%VSLATESTDIR%"\\VC\\Auxiliary\\Build\\vcvarsall.bat %Comp_x86%
) else if "%2"=="x64" (
call "%VSLATESTDIR%"\\VC\\Auxiliary\\Build\\vcvarsall.bat %Comp_x64%
)
set MSYS2_PATH_TYPE=inherit
if not defined MSYS2_BIN (
if exist C:\msys64\usr\bin\bash.exe set MSYS2_BIN="C:\msys64\usr\bin\bash.exe"
)
if not defined MSYS2_BIN (
if exist C:\msys\usr\bin\bash.exe set MSYS2_BIN="C:\msys\usr\bin\bash.exe"
)
if /I %3 equ "" (
goto build_all
) else (
goto build_one
)
:build_all
set "keyname="
for %%I in (%TOBUILD%) do (
if not defined keyname (
set keyname=%%I
) else (
echo building: !keyname!
call :build %%I %1 %2
set %%keyname%%=%%I
set "keyname="
)
)
goto cleanup
:build_one
set found="N"
set "keyname="
for %%I in (%TOBUILD%) do (
if not defined keyname (
set keyname=%%I
) else (
if /I %3 equ !keyname! (
echo building: !keyname!
set found="Y"
call :build %%I %1 %2
goto cleanup
)
set %%keyname%%=%%I
set "keyname="
)
)
if %found%=="N" (
echo "%3" not in listed contrib
)
goto cleanup
:parameterError
echo "parameter error"
goto cleanup
:cleanup
endlocal
@endlocal
if %ERRORLEVEL% geq 1 (
echo build_all failed
exit %ERRORLEVEL%
) else (
echo build_all succeeded
exit /B %ERRORLEVEL%
)
:build
if /I %1 equ ffmpeg (
%MSYS2_BIN% --login -x %CONTRIB_DIR%src/ffmpeg/windows-configure-make.sh %2 %3
) else if /I %1 equ pjproject (
goto build_pjproject %2 %3
) else if /I %1 equ openssl (
goto build_openssl %2 %3
) else (
msbuild %CONTRIB_DIR%%1 %MSBUILD_ARGS%
)
if %ERRORLEVEL% geq 1 (
goto cleanup
)
goto :eof
:build_openssl
:: build openssl
cd %CONTRIB_DIR%build\openssl
if "%2"=="win32" (
call perl Configure VC-WIN64A
call ms\do_win64a
) else if "%2"=="uwp" (
call perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL
call ms\do_winuniversal
call ms\setVSvars universal10.0x64
)
call nmake -f ms\ntdll.mak
set PATH=restbed\dependency\openssl\out32dll;%PATH%
goto :eof
:build_pjproject
setlocal
set "keyname="
for %%I in (%PJTOBUILD%) do (
if not defined keyname (
set keyname=%%I
) else (
echo building: !keyname!
call :build %%I %1 %2
set %%keyname%%=%%I
set "keyname="
)
)
endlocal
\ No newline at end of file
set BUILD=%SRC%..\build
set ARGON2_VERSION=670229c849b9fe882583688b74eb7dfdc846f9f6
set ARGON2_URL=https://github.com/P-H-C/phc-winner-argon2/archive/%ARGON2_VERSION%.tar.gz
mkdir %BUILD%
if %USE_CACHE%==1 (
copy %CACHE_DIR%\%ARGON2_VERSION%.tar.gz %cd%
) else (
%WGET_CMD% %ARGON2_URL%
)
7z -y x %ARGON2_VERSION%.tar.gz && 7z -y x %ARGON2_VERSION%.tar -o%BUILD%
del %ARGON2_VERSION%.tar && del %ARGON2_VERSION%.tar.gz && del %BUILD%\pax_global_header
rename %BUILD%\phc-winner-argon2-%ARGON2_VERSION% argon2
cd %BUILD%\argon2
%APPLY_CMD% %SRC%\argon2\argon2-vs2017.patch
cd %SRC%
\ No newline at end of file
{
"name": "argon2",
"version": "670229c849b9fe882583688b74eb7dfdc846f9f6",
"url": "https://github.com/P-H-C/phc-winner-argon2/archive/__VERSION__.tar.gz",
"deps": [],
"patches": [],
"win_patches": ["argon2-vs2017.patch"],
"project_paths": ["vs2015/Argon2Ref/Argon2Ref.vcxproj"],
"with_env" : "",
"custom_scripts": {
"pre_build": [],
"build": [],
"post_build": []
}
}
\ No newline at end of file
set BUILD=%SRC%..\build
set ASIO_VERSION=asio-1-12-2
set ASIO_URL=https://github.com/chriskohlhoff/asio/archive/%ASIO_VERSION%.tar.gz
mkdir %BUILD%
%WGET_CMD% %ASIO_URL%
7z -y x %ASIO_VERSION%.tar.gz && 7z -y x %ASIO_VERSION%.tar -o%BUILD%
del %ASIO_VERSION%.tar && del %ASIO_VERSION%.tar.gz && del %BUILD%\pax_global_header
rename %BUILD%\asio-%ASIO_VERSION% asio
cd %BUILD%\asio
%APPLY_CMD% %SRC%asio\asio-vcxproj.patch
if "%1"=="uwp" (
%APPLY_CMD% %SRC%asio\asio-uwp.patch
)
cd %SRC%
\ No newline at end of file
{
"name": "asio",
"version": "asio-1-12-2",
"url": "https://github.com/chriskohlhoff/asio/archive/__VERSION__.tar.gz",
"deps": ["openssl"],
"patches": [],
"win_patches": [
"asio-vcxproj.patch"
],
"project_paths": [
"asio/msvc/asio.vcxproj"
],
"with_env" : "",
"custom_scripts": {
"pre_build": [],
"build": [],
"post_build": []
}
}
\ No newline at end of file
@echo off
@setlocal enabledelayedexpansion
echo fetching and patching contrib for %1
if "%USE_CACHE%"=="" (
set USE_CACHE=0
)