build script for vc "msbuild.bat":
* check given architecture * output possible architectures
This commit is contained in:
parent
7dfac3e237
commit
08e73f83b2
@ -6,12 +6,14 @@ rem %4 = configuration (Release|Debug)
|
||||
rem %5 = build tests (|+tests)
|
||||
|
||||
if "%4" NEQ "" if "%3" NEQ "" if "%2" NEQ "" if "%1" NEQ "" goto cont
|
||||
echo usage: msbuild arcitecture library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
call :get_architectures -
|
||||
echo usage: msbuild architecture=^<%architectures:|=^|%^> library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
goto :eof
|
||||
|
||||
:cont
|
||||
rem example use: msbuild sandybridge_ivybridge dll x64 release
|
||||
|
||||
if not exist "lib_mpir_%1" (call :get_architectures & call :seterr & echo ERROR: architecture is one of %architectures% ^(not "%1"^) & exit /b %errorlevel%)
|
||||
if /i "%2" EQU "DLL" (set libp=dll) else (if /i "%2" EQU "LIB" (set libp=lib) else ((call :seterr & echo ERROR: library type is "lib" or "dll" ^(not "%2"^) & exit /b %errorlevel%)))
|
||||
if /i "%3" EQU "x64" (set plat=x64) else (if /i "%3" EQU "Win32" (set plat=win32) else (call :seterr & echo ERROR: platform is "Win32" or "x64" ^(not "%3"^) & exit /b %errorlevel%))
|
||||
if /i "%4" EQU "Debug" (set conf=Debug) else (if /i "%4" EQU "Release" (set conf=Release) else (call :seterr & echo ERROR: configuration is "Release" or "Debug" ^(not "%4"^) & exit /b %errorlevel%))
|
||||
@ -20,6 +22,7 @@ set src=%libp%_mpir_%1
|
||||
|
||||
rem This is the directory where Microsoft MSBUILD is installed
|
||||
set msbdir="C:\Program Files (x86)\MSBuild\14.0\Bin"
|
||||
|
||||
rem This is the Visual Studio build directory (within the MPIR directory)
|
||||
set srcdir="."
|
||||
|
||||
@ -37,6 +40,31 @@ if /i "%5" EQU "+tests" (
|
||||
)
|
||||
)
|
||||
|
||||
:get_architectures
|
||||
set architectures=
|
||||
for /d %%a in (lib_mpir_*) do (call :add_architecture %%a %1)
|
||||
goto :eof
|
||||
|
||||
:add_architecture
|
||||
for /f "tokens=3,* delims=_" %%a in ("%1") do set arch=%%a
|
||||
if _%2_ == __ (
|
||||
set "delim= or "
|
||||
set arch=^"%arch%^"
|
||||
) else (
|
||||
set delim=^|
|
||||
)
|
||||
|
||||
if "%architectures%" == "" (
|
||||
set "architectures=%arch%"
|
||||
) else (
|
||||
set "architectures=%architectures%%delim%%arch%"
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:set_arch
|
||||
set arch=%1
|
||||
goto :eof
|
||||
|
||||
:clrerr
|
||||
exit /b 0
|
||||
|
||||
|
@ -6,12 +6,14 @@ rem %4 = configuration (Release|Debug)
|
||||
rem %5 = build tests (|+tests)
|
||||
|
||||
if "%4" NEQ "" if "%3" NEQ "" if "%2" NEQ "" if "%1" NEQ "" goto cont
|
||||
echo usage: msbuild arcitecture library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
call :get_architectures -
|
||||
echo usage: msbuild architecture=^<%architectures:|=^|%^> library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
goto :eof
|
||||
|
||||
:cont
|
||||
rem example use: msbuild sandybridge_ivybridge dll x64 release
|
||||
|
||||
if not exist "lib_mpir_%1" (call :get_architectures & call :seterr & echo ERROR: architecture is one of %architectures% ^(not "%1"^) & exit /b %errorlevel%)
|
||||
if /i "%2" EQU "DLL" (set libp=dll) else (if /i "%2" EQU "LIB" (set libp=lib) else ((call :seterr & echo ERROR: library type is "lib" or "dll" ^(not "%2"^) & exit /b %errorlevel%)))
|
||||
if /i "%3" EQU "x64" (set plat=x64) else (if /i "%3" EQU "Win32" (set plat=win32) else (call :seterr & echo ERROR: platform is "Win32" or "x64" ^(not "%3"^) & exit /b %errorlevel%))
|
||||
if /i "%4" EQU "Debug" (set conf=Debug) else (if /i "%4" EQU "Release" (set conf=Release) else (call :seterr & echo ERROR: configuration is "Release" or "Debug" ^(not "%4"^) & exit /b %errorlevel%))
|
||||
@ -20,6 +22,7 @@ set src=%libp%_mpir_%1
|
||||
|
||||
rem This is the directory where Microsoft MSBUILD is installed
|
||||
set msbdir="C:\Program Files (x86)\MSBuild\14.0\Bin"
|
||||
|
||||
rem This is the Visual Studio build directory (within the MPIR directory)
|
||||
set srcdir="."
|
||||
|
||||
@ -37,6 +40,31 @@ if /i "%5" EQU "+tests" (
|
||||
)
|
||||
)
|
||||
|
||||
:get_architectures
|
||||
set architectures=
|
||||
for /d %%a in (lib_mpir_*) do (call :add_architecture %%a %1)
|
||||
goto :eof
|
||||
|
||||
:add_architecture
|
||||
for /f "tokens=3,* delims=_" %%a in ("%1") do set arch=%%a
|
||||
if _%2_ == __ (
|
||||
set "delim= or "
|
||||
set arch=^"%arch%^"
|
||||
) else (
|
||||
set delim=^|
|
||||
)
|
||||
|
||||
if "%architectures%" == "" (
|
||||
set "architectures=%arch%"
|
||||
) else (
|
||||
set "architectures=%architectures%%delim%%arch%"
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:set_arch
|
||||
set arch=%1
|
||||
goto :eof
|
||||
|
||||
:clrerr
|
||||
exit /b 0
|
||||
|
||||
|
@ -6,12 +6,14 @@ rem %4 = configuration (Release|Debug)
|
||||
rem %5 = build tests (|+tests)
|
||||
|
||||
if "%4" NEQ "" if "%3" NEQ "" if "%2" NEQ "" if "%1" NEQ "" goto cont
|
||||
echo usage: msbuild arcitecture library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
call :get_architectures -
|
||||
echo usage: msbuild architecture=^<%architectures:|=^|%^> library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
goto :eof
|
||||
|
||||
:cont
|
||||
rem example use: msbuild sandybridge_ivybridge dll x64 release
|
||||
|
||||
if not exist "lib_mpir_%1" (call :get_architectures & call :seterr & echo ERROR: architecture is one of %architectures% ^(not "%1"^) & exit /b %errorlevel%)
|
||||
if /i "%2" EQU "DLL" (set libp=dll) else (if /i "%2" EQU "LIB" (set libp=lib) else ((call :seterr & echo ERROR: library type is "lib" or "dll" ^(not "%2"^) & exit /b %errorlevel%)))
|
||||
if /i "%3" EQU "x64" (set plat=x64) else (if /i "%3" EQU "Win32" (set plat=win32) else (call :seterr & echo ERROR: platform is "Win32" or "x64" ^(not "%3"^) & exit /b %errorlevel%))
|
||||
if /i "%4" EQU "Debug" (set conf=Debug) else (if /i "%4" EQU "Release" (set conf=Release) else (call :seterr & echo ERROR: configuration is "Release" or "Debug" ^(not "%4"^) & exit /b %errorlevel%))
|
||||
@ -20,6 +22,7 @@ set src=%libp%_mpir_%1
|
||||
|
||||
rem This is the directory where Microsoft MSBUILD is installed
|
||||
set msbdir="C:\Program Files (x86)\MSBuild\14.0\Bin"
|
||||
|
||||
rem This is the Visual Studio build directory (within the MPIR directory)
|
||||
set srcdir="."
|
||||
|
||||
@ -37,6 +40,31 @@ if /i "%5" EQU "+tests" (
|
||||
)
|
||||
)
|
||||
|
||||
:get_architectures
|
||||
set architectures=
|
||||
for /d %%a in (lib_mpir_*) do (call :add_architecture %%a %1)
|
||||
goto :eof
|
||||
|
||||
:add_architecture
|
||||
for /f "tokens=3,* delims=_" %%a in ("%1") do set arch=%%a
|
||||
if _%2_ == __ (
|
||||
set "delim= or "
|
||||
set arch=^"%arch%^"
|
||||
) else (
|
||||
set delim=^|
|
||||
)
|
||||
|
||||
if "%architectures%" == "" (
|
||||
set "architectures=%arch%"
|
||||
) else (
|
||||
set "architectures=%architectures%%delim%%arch%"
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:set_arch
|
||||
set arch=%1
|
||||
goto :eof
|
||||
|
||||
:clrerr
|
||||
exit /b 0
|
||||
|
||||
|
@ -6,12 +6,14 @@ rem %4 = configuration (Release|Debug)
|
||||
rem %5 = build tests (|+tests)
|
||||
|
||||
if "%4" NEQ "" if "%3" NEQ "" if "%2" NEQ "" if "%1" NEQ "" goto cont
|
||||
echo usage: msbuild arcitecture library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
call :get_architectures -
|
||||
echo usage: msbuild architecture=^<%architectures:|=^|%^> library_type=^<LIB^|DLL^> platform=^<Win32^|x64^> configuration=^<Release^|Debug^>
|
||||
goto :eof
|
||||
|
||||
:cont
|
||||
rem example use: msbuild sandybridge_ivybridge dll x64 release
|
||||
|
||||
if not exist "lib_mpir_%1" (call :get_architectures & call :seterr & echo ERROR: architecture is one of %architectures% ^(not "%1"^) & exit /b %errorlevel%)
|
||||
if /i "%2" EQU "DLL" (set libp=dll) else (if /i "%2" EQU "LIB" (set libp=lib) else ((call :seterr & echo ERROR: library type is "lib" or "dll" ^(not "%2"^) & exit /b %errorlevel%)))
|
||||
if /i "%3" EQU "x64" (set plat=x64) else (if /i "%3" EQU "Win32" (set plat=win32) else (call :seterr & echo ERROR: platform is "Win32" or "x64" ^(not "%3"^) & exit /b %errorlevel%))
|
||||
if /i "%4" EQU "Debug" (set conf=Debug) else (if /i "%4" EQU "Release" (set conf=Release) else (call :seterr & echo ERROR: configuration is "Release" or "Debug" ^(not "%4"^) & exit /b %errorlevel%))
|
||||
@ -38,6 +40,31 @@ if /i "%5" EQU "+tests" (
|
||||
)
|
||||
)
|
||||
|
||||
:get_architectures
|
||||
set architectures=
|
||||
for /d %%a in (lib_mpir_*) do (call :add_architecture %%a %1)
|
||||
goto :eof
|
||||
|
||||
:add_architecture
|
||||
for /f "tokens=3,* delims=_" %%a in ("%1") do set arch=%%a
|
||||
if _%2_ == __ (
|
||||
set "delim= or "
|
||||
set arch=^"%arch%^"
|
||||
) else (
|
||||
set delim=^|
|
||||
)
|
||||
|
||||
if "%architectures%" == "" (
|
||||
set "architectures=%arch%"
|
||||
) else (
|
||||
set "architectures=%architectures%%delim%%arch%"
|
||||
)
|
||||
goto :eof
|
||||
|
||||
:set_arch
|
||||
set arch=%1
|
||||
goto :eof
|
||||
|
||||
:clrerr
|
||||
exit /b 0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user