James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 1 | :: |
| 2 | :: Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | :: you may not use this file except in compliance with the License. |
| 4 | :: You may obtain a copy of the License at |
| 5 | :: |
| 6 | :: http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | :: |
| 8 | :: Unless required by applicable law or agreed to in writing, software |
| 9 | :: distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | :: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | :: See the License for the specific language governing permissions and |
| 12 | :: limitations under the License. |
| 13 | :: |
| 14 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 15 | @ECHO OFF |
| 16 | |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 17 | IF "%PROFILE%" == "MSVC2010" ( |
| 18 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %PLATFORM% |
| 19 | ) ELSE IF "%PROFILE%" == "MSVC2012" ( |
| 20 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" %PLATFORM% |
| 21 | ) ELSE IF "%PROFILE%" == "MSVC2013" ( |
| 22 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% |
| 23 | ) ELSE IF "%PROFILE%" == "MSVC2015" ( |
| 24 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% |
| 25 | ) ELSE IF "%PROFILE%" == "MSVC2017" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 26 | CALL :SETUPNEWERMSVC || EXIT /B |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 27 | ) ELSE IF "%PROFILE%" == "MINGW" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 28 | REM Supported, nothing special to do here. |
| 29 | ) ELSE IF "%PROFILE%" == "CYGWIN" ( |
| 30 | REM Supported, nothing special to do here. |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 31 | ) ELSE ( |
| 32 | ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM% |
| 33 | EXIT /B 1 |
| 34 | ) |
| 35 | |
| 36 | CALL cl_setcompiler.bat || EXIT /B |
| 37 | CALL cl_setgenerator.bat || EXIT /B |
| 38 | |
| 39 | SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 40 | SET BUILDCACHE=%APPVEYOR_BUILD_FOLDER%\..\build\cache |
| 41 | SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% |
| 42 | SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 43 | SET SRCDIR=%APPVEYOR_BUILD_FOLDER% |
| 44 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 45 | :: PLATFORM is x64 or x86 |
| 46 | :: NORM_PLATFORM is 64 or 32 |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 47 | SET NORM_PLATFORM=%PLATFORM:~-2,2% |
| 48 | IF "%NORM_PLATFORM%" == "86" (SET NORM_PLATFORM=32) |
| 49 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 50 | IF "%PROFILE:~0,4%" == "MSVC" ( |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 51 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 52 | :: FindBoost needs forward slashes so cmake doesn't see something as an escaped character |
| 53 | SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_% |
| 54 | SET BOOST_LIBRARYDIR=!BOOST_ROOT!/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.%COMPILER:~-1,1% |
| 55 | SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM% |
| 56 | SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 57 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 58 | :: MSVC2010 doesn't "do" std::thread |
| 59 | IF "%COMPILER%" == "vc100" ( |
| 60 | SET THREADMODEL=BOOST |
| 61 | ) ELSE ( |
| 62 | SET THREADMODEL=STD |
| 63 | ) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 64 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 65 | IF "%PYTHON_VERSION%" == "" ( |
| 66 | SET WITH_PYTHON=OFF |
| 67 | ) ELSE ( |
| 68 | SET WITH_PYTHON=ON |
| 69 | IF /i "%PLATFORM%" == "x64" SET PTEXT=-x64 |
| 70 | SET PATH=C:\Python%PYTHON_VERSION:.=%!PTEXT!\scripts;C:\Python%PYTHON_VERSION:.=%!PTEXT!;!PATH! |
| 71 | ) |
| 72 | IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 73 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 74 | IF NOT "%QT_VERSION%" == "" ( |
| 75 | IF /i "%PLATFORM%" == "x64" SET QTEXT=_64 |
| 76 | SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH! |
| 77 | ) |
| 78 | |
| 79 | ) ELSE IF "%PROFILE:~0,4%" == "MING" ( |
| 80 | |
| 81 | :: PLATFORM = x86 means MINGWPLAT i686 |
| 82 | :: PLATFORM = x64 means MINGWPLAT x86_64 |
| 83 | SET MINGWPLAT=x86_64 |
| 84 | IF "%PLATFORM%" == "x86" (SET MINGWPLAT=i686) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 85 | |
| 86 | SET BASH=C:\msys64\usr\bin\bash.exe |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 87 | !BASH! -lc "sed -i '/export PATH=\/mingw32\/bin/d' ~/.bash_profile && sed -i '/export PATH=\/mingw64\/bin/d' ~/.bash_profile && echo 'export PATH=/mingw%NORM_PLATFORM%/bin:$PATH' >> ~/.bash_profile" || EXIT /B |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 88 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 89 | SET BUILDDIR=%BUILDDIR:\=/% |
| 90 | SET BUILDDIR=/c!BUILDDIR:~2! |
| 91 | SET INSTDIR=%INSTDIR:\=/% |
| 92 | SET INSTDIR=/c!INSTDIR:~2! |
| 93 | SET SRCDIR=%SRCDIR:\=/% |
| 94 | SET SRCDIR=/c!SRCDIR:~2! |
| 95 | |
| 96 | ) ELSE IF "%PROFILE:~0,4%" == "CYGW" ( |
| 97 | |
| 98 | SET CYGWINROOT=C:\cygwin |
| 99 | IF "%PLATFORM%" == "x64" (SET CYGWINROOT=!CYGWINROOT!64) |
| 100 | |
| 101 | SET BASH=!CYGWINROOT!\bin\bash.exe |
| 102 | SET SETUP=!CYGWINROOT!\setup-x86 |
| 103 | IF "%PLATFORM%" == "x64" (SET SETUP=!SETUP!_64) |
| 104 | SET SETUP=!SETUP!.exe |
| 105 | |
| 106 | SET BUILDDIR=%BUILDDIR:\=/% |
| 107 | SET BUILDDIR=/cygdrive/c!BUILDDIR:~2! |
| 108 | SET INSTDIR=%INSTDIR:\=/% |
| 109 | SET INSTDIR_CYG=/cygdrive/c!INSTDIR:~2! |
| 110 | SET SRCDIR=%SRCDIR:\=/% |
| 111 | SET SRCDIR=/cygdrive/c!SRCDIR:~2! |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 112 | |
| 113 | ) |
| 114 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame^] | 115 | GOTO :EOF |
| 116 | |
| 117 | :SETUPNEWERMSVC |
| 118 | FOR /F "USEBACKQ TOKENS=*" %%i IN (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[15.0,16.0)" -property installationPath`) DO ( |
| 119 | IF "%MSVCROOT%" == "" (SET MSVCROOT=%%i) |
| 120 | ) |
| 121 | SET MSVCPLAT=x86 |
| 122 | IF "%PLATFORM%" == "x64" (SET MSVCPLAT=amd64) |
| 123 | |
| 124 | SET CURRENTDIR=%CD% |
| 125 | CALL "!MSVCROOT!\Common7\Tools\VsDevCmd.bat" -arch=!MSVCPLAT! || EXIT /B |
| 126 | CD %CURRENTDIR% |
| 127 | EXIT /B |
| 128 | |
| 129 | :EOF |