Salome HOME
spns #32926: backport KERNEL & CONFIGURATION fixes on more recent platforms to ensure...
[tools/sat_salome.git] / products / compil_scripts / tbb.bat
1 @echo off
2
3 echo ##########################################################################
4 echo Threading Building Blocks %VERSION%
5 echo ##########################################################################
6
7 if exist "%BUILD_DIR%" rmdir /Q /S "%BUILD_DIR%"
8 mkdir %BUILD_DIR%
9
10 SET MSBUILDDISABLENODEREUSE=1
11 cd %SOURCE_DIR%
12 xcopy * %BUILD_DIR% /E /I /Q
13 if NOT %ERRORLEVEL% == 0 (
14     echo ERROR on xcopy
15     exit 1
16 )
17
18 if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL%
19
20 if NOT defined CYGWIN_ROOT_DIR (
21   echo ERROR: Please set the environment variable: CYGWIN_ROOT_DIR
22   exit 1
23 ) else (
24   echo INFO: Cygwin suite environment variable is set to: %CYGWIN_ROOT_DIR%
25 )
26
27 cd %BUILD_DIR%
28
29 REM pay attention to ROBOCOY 1: One or more files were copied successfully (that is, new files have arrived)
30 robocopy %BUILD_DIR%\build\vs2013 %BUILD_DIR%\build\vs2017  /E /NP /NFL /NDL /NS /NC
31 if NOT %ERRORLEVEL% == 1 (
32     echo ERROR when renaming subfolder %BUILD_DIR%\build\vs2013
33     exit 2
34 )
35
36 echo.
37 echo --------------------------------------------------------------------------
38 echo *** start compilation
39 echo --------------------------------------------------------------------------
40 REM Upgrade to current version of MSVC
41 echo.
42 echo *** devenv %BUILD_DIR%\build\vs2017\makefile.sln /upgrade
43 devenv %BUILD_DIR%\build\vs2017\makefile.sln /upgrade
44 if NOT %ERRORLEVEL% == 0 (
45     echo ERROR on devenv
46     exit 3
47 )
48 REM remove the residual file named nul which is a reserved field for Windows...
49 set PATH=%PATH%;%CYGWIN_ROOT_DIR%\bin
50
51 %PYTHON_ROOT_DIR%\python.exe %SOURCE_DIR:\=/%/build/build.py --install --install-python --vs=2017 --msbuild --prefix=%PRODUCT_INSTALL:\=/%
52 if NOT %ERRORLEVEL% == 0 (
53     echo ERROR on %PYTHON_ROOT_DIR%\python.exe %SOURCE_DIR:\=/%/build/build.py
54     exit 4
55 )
56
57 REM remove the residual file named nul which is a reserved field for Windows...
58 mv %BUILD_DIR%\src\nul %BUILD_DIR%\src\null.txt
59
60 taskkill /F /IM "mspdbsrv.exe"
61
62 echo.
63 echo ########## END