mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
Windows build scripts: detect case where user installed Visual Studio but not the C++ toolset. Also detect case where user's CMake version is too old for the desired generator.
This commit is contained in:
+10
-2
@@ -33,10 +33,18 @@ setlocal EnableDelayedExpansion
|
||||
|
||||
:: Make sure vcvarsall.bat is called and dev env set is up.
|
||||
IF "%VSINSTALLDIR%"=="" (
|
||||
call utils\cecho.cmd 0 12 "Visual Studio environment variables not set - cannot proceed!"
|
||||
call utils\cecho.cmd 0 12 "Visual Studio environment variables not set- cannot proceed."
|
||||
GOTO :ErrorAndPrintUsage
|
||||
)
|
||||
|
||||
:: Check for cl.exe - at least the "Typical" Visual Studio 2015 installation does not include the C++ toolset by default,
|
||||
:: http://blogs.msdn.com/b/vcblog/archive/2015/07/24/setup-changes-in-visual-studio-2015-affecting-c-developers.aspx
|
||||
where cl.exe 2>&1>NUL
|
||||
if not %ERRORLEVEL%==0 (
|
||||
call utils\cecho.cmd 0 12 "%~nx0: cl.exe not in PATH. Make sure to select the C++ toolset when installing Visual Studio- cannot proceed."
|
||||
GOTO :ErrorAndPrintUsage
|
||||
)
|
||||
|
||||
:: Set up variables depending on the used Visual Studio version
|
||||
call vs-cfg.cmd %1 %2
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
@@ -422,7 +430,7 @@ echo 2. Install Git and make sure 'git' is accessible from PATH.
|
||||
echo - http://code.google.com/p/tortoisegit/
|
||||
echo 3. Install CMake and make sure 'cmake' is accessible from PATH.
|
||||
echo - http://www.cmake.org/
|
||||
echo 4. Visual Studio 2008 or newer (2013 or newer recommended).
|
||||
echo 4. Visual Studio 2008 or newer (2013 or newer recommended) with C++ toolset.
|
||||
echo - https://www.visualstudio.com/
|
||||
echo 5. Run this batch script with Visual Studio environment variables set.
|
||||
echo - https://msdn.microsoft.com/en-us/library/ms229859(v=vs.110).aspx
|
||||
|
||||
+10
-3
@@ -47,7 +47,7 @@ set GENERATORS[8]="Visual Studio 14 2015 Win64"
|
||||
set GENERATORS[9]="Visual Studio 14 2015"
|
||||
set LAST_GENERATOR_IDX=9
|
||||
|
||||
REM Deduce desired architecture from the location of cl.exe
|
||||
:: Deduce desired architecture from the location of cl.exe
|
||||
where cl.exe | findstr /r /c:"amd64" >nul
|
||||
set START=%ERRORLEVEL%
|
||||
set STEP=2
|
||||
@@ -65,11 +65,18 @@ IF "!GENERATOR!"=="" IF NOT "%VisualStudioVersion%"=="" (
|
||||
)
|
||||
)
|
||||
)
|
||||
:: Check that the used CMake version supports the chosen generator
|
||||
set GENERATOR_CHECK=%GENERATOR: Win64=%
|
||||
cmake --help | findstr /c:%GENERATOR_CHECK%
|
||||
if not %ERRORLEVEL%==0 (
|
||||
call utils\cecho.cmd 0 12 "%~nx0: The used CMake version does not support '`"!GENERATOR!`'"- cannot proceed."
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
FOR /l %%i in (0,1,%LAST_GENERATOR_IDX%) DO (
|
||||
IF !GENERATOR!==!GENERATORS[%%i]! GOTO :GeneratorValid
|
||||
)
|
||||
call utils\cecho.cmd 0 12 "%~nx0: Invalid or unsupported CMake generator string passed: '`"!GENERATOR!`'". Cannot proceed, aborting!"
|
||||
call utils\cecho.cmd 0 12 "%~nx0: Invalid or unsupported CMake generator string passed: '`"!GENERATOR!`'"- cannot proceed."
|
||||
echo Supported CMake generator strings:
|
||||
FOR /l %%i in (0,1,%LAST_GENERATOR_IDX%) DO (
|
||||
echo !GENERATORS[%%i]!
|
||||
@@ -133,7 +140,7 @@ IF "!BUILD_CFG!"=="" (
|
||||
)
|
||||
IF NOT !BUILD_CFG!==%BUILD_CFG_MINSIZEREL% IF NOT !BUILD_CFG!==%BUILD_CFG_RELEASE% (
|
||||
IF NOT !BUILD_CFG!==%BUILD_CFG_RELWITHDEBINFO% IF NOT !BUILD_CFG!==%BUILD_CFG_DEBUG% (
|
||||
call utils\cecho.cmd 0 12 "%~nx0: Invalid or unsupported CMake build configuration type passed: !BUILD_CFG!. Cannot proceed, aborting!"
|
||||
call utils\cecho.cmd 0 12 "%~nx0: Invalid or unsupported CMake build configuration type passed: !BUILD_CFG!. Cannot proceed."
|
||||
exit /b 1
|
||||
))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user