diff --git a/.gitignore b/.gitignore index 9a71d4bcd..a06c2afa2 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ projects/VS2010 projects/VS2012 projects/VS2013 projects/VS2015 +build/bin # IDEA solution files *.idea diff --git a/build/build.VS2010.cmd b/build/build.VS2010.cmd new file mode 100644 index 000000000..c3bc1763e --- /dev/null +++ b/build/build.VS2010.cmd @@ -0,0 +1,7 @@ +@echo off + +rem build 32-bit +call "%~p0%build.generic.cmd" VS2010 Win32 Release v100 + +rem build 64-bit +call "%~p0%build.generic.cmd" VS2010 x64 Release v100 \ No newline at end of file diff --git a/build/build.VS2012.cmd b/build/build.VS2012.cmd new file mode 100644 index 000000000..d7399a9d6 --- /dev/null +++ b/build/build.VS2012.cmd @@ -0,0 +1,6 @@ +@echo off + +rem build 32-bit +call "%~p0%build.generic.cmd" VS2012 Win32 Release v110 +rem build 64-bit +call "%~p0%build.generic.cmd" VS2012 x64 Release v110 \ No newline at end of file diff --git a/build/build.VS2013.cmd b/build/build.VS2013.cmd new file mode 100644 index 000000000..486ba6cf0 --- /dev/null +++ b/build/build.VS2013.cmd @@ -0,0 +1,7 @@ +@echo off + +rem build 32-bit +call "%~p0%build.generic.cmd" VS2013 Win32 Release v120 + +rem build 64-bit +call "%~p0%build.generic.cmd" VS2013 x64 Release v120 \ No newline at end of file diff --git a/build/build.VS2015.cmd b/build/build.VS2015.cmd new file mode 100644 index 000000000..abc41c9a0 --- /dev/null +++ b/build/build.VS2015.cmd @@ -0,0 +1,7 @@ +@echo off + +rem build 32-bit +call "%~p0%build.generic.cmd" VS2015 Win32 Release v140 + +rem build 64-bit +call "%~p0%build.generic.cmd" VS2015 x64 Release v140 \ No newline at end of file diff --git a/build/build.generic.cmd b/build/build.generic.cmd new file mode 100644 index 000000000..502c8db95 --- /dev/null +++ b/build/build.generic.cmd @@ -0,0 +1,51 @@ +@echo off + +IF "%1%" == "" GOTO display_help + +SET vs_version=%1 + +SET vs_platform=%2 +IF "%vs_platform%" == "" SET vs_platform=x64 + +SET vs_configuration=%3 +IF "%vs_configuration%" == "" SET vs_configuration=Release + +SET vs_toolset=%4 + +GOTO build + +:display_help + +echo Syntax: build.generic.cmd vs_version vs_platform vs_configuration vs_toolset +echo vs_version: VS installed version (VS2012, VS2013, VS2015, ...) +echo vs_platform: Platform (x64 or Win32) +echo vs_configuration: VS configuration (Release or Debug) +echo vs_toolset: Platform Toolset (v100, v110, v120, v140) + +EXIT /B 1 + +:build + +SET msbuild="%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" +IF %vs_version% == VS2013 SET msbuild="C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" +IF %vs_version% == VS2015 SET msbuild="C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" +rem TODO: Visual Studio "15" (vNext) will use MSBuild 15.0 ? + +SET project="%~p0\..\projects\VS2010\zstd.sln" + +SET msbuildparams=/verbosity:minimal /nologo /t:Clean,Build /p:Platform=%vs_platform% /p:Configuration=%vs_configuration% +IF NOT "%vs_toolset%" == "" SET msbuildparams=%msbuildparams% /p:PlatformToolset=%vs_toolset% + +SET output=%~p0%bin +SET output="%output%/%vs_configuration%/%vs_platform%/" +SET msbuildparams=%msbuildparams% /p:OutDir=%output% + +echo ### Building %vs_version% project for %vs_configuration% %vs_platform% (%vs_toolset%)... +echo ### Build Params: %msbuildparams% + +%msbuild% %project% %msbuildparams% +IF ERRORLEVEL 1 EXIT /B 1 +echo # Success +echo # OutDir: %output% +echo # +