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 | |
cyy | f23e6a5 | 2019-01-05 14:00:03 +0800 | [diff] [blame] | 17 | IF "%PROFILE%" == "MSVC2012" ( |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 18 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\vcvarsall.bat" %PLATFORM% |
| 19 | ) ELSE IF "%PROFILE%" == "MSVC2013" ( |
| 20 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %PLATFORM% |
| 21 | ) ELSE IF "%PROFILE%" == "MSVC2015" ( |
| 22 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% |
| 23 | ) ELSE IF "%PROFILE%" == "MSVC2017" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 24 | CALL :SETUPNEWERMSVC || EXIT /B |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 25 | ) ELSE IF "%PROFILE%" == "MINGW" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 26 | REM Supported, nothing special to do here. |
| 27 | ) ELSE IF "%PROFILE%" == "CYGWIN" ( |
| 28 | REM Supported, nothing special to do here. |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 29 | ) ELSE ( |
| 30 | ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM% |
| 31 | EXIT /B 1 |
| 32 | ) |
| 33 | |
| 34 | CALL cl_setcompiler.bat || EXIT /B |
| 35 | CALL cl_setgenerator.bat || EXIT /B |
| 36 | |
| 37 | SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 38 | SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% |
| 39 | SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 40 | SET SRCDIR=%APPVEYOR_BUILD_FOLDER% |
| 41 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 42 | :: PLATFORM is x64 or x86 |
| 43 | :: NORM_PLATFORM is 64 or 32 |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 44 | SET NORM_PLATFORM=%PLATFORM:~-2,2% |
| 45 | IF "%NORM_PLATFORM%" == "86" (SET NORM_PLATFORM=32) |
| 46 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 47 | IF "%PROFILE:~0,4%" == "MSVC" ( |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 48 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 49 | :: FindBoost needs forward slashes so cmake doesn't see something as an escaped character |
| 50 | SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_% |
| 51 | SET BOOST_LIBRARYDIR=!BOOST_ROOT!/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.%COMPILER:~-1,1% |
| 52 | SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM% |
| 53 | SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 54 | |
cyy | f23e6a5 | 2019-01-05 14:00:03 +0800 | [diff] [blame] | 55 | SET THREADMODEL=STD |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 56 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 57 | IF "%PYTHON_VERSION%" == "" ( |
| 58 | SET WITH_PYTHON=OFF |
| 59 | ) ELSE ( |
| 60 | SET WITH_PYTHON=ON |
| 61 | IF /i "%PLATFORM%" == "x64" SET PTEXT=-x64 |
| 62 | SET PATH=C:\Python%PYTHON_VERSION:.=%!PTEXT!\scripts;C:\Python%PYTHON_VERSION:.=%!PTEXT!;!PATH! |
| 63 | ) |
| 64 | IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 65 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 66 | IF NOT "%QT_VERSION%" == "" ( |
| 67 | IF /i "%PLATFORM%" == "x64" SET QTEXT=_64 |
| 68 | SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH! |
| 69 | ) |
| 70 | |
| 71 | ) ELSE IF "%PROFILE:~0,4%" == "MING" ( |
| 72 | |
| 73 | :: PLATFORM = x86 means MINGWPLAT i686 |
| 74 | :: PLATFORM = x64 means MINGWPLAT x86_64 |
| 75 | SET MINGWPLAT=x86_64 |
| 76 | IF "%PLATFORM%" == "x86" (SET MINGWPLAT=i686) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 77 | |
| 78 | SET BASH=C:\msys64\usr\bin\bash.exe |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 79 | !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] | 80 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 81 | SET BUILDDIR=%BUILDDIR:\=/% |
| 82 | SET BUILDDIR=/c!BUILDDIR:~2! |
| 83 | SET INSTDIR=%INSTDIR:\=/% |
| 84 | SET INSTDIR=/c!INSTDIR:~2! |
| 85 | SET SRCDIR=%SRCDIR:\=/% |
| 86 | SET SRCDIR=/c!SRCDIR:~2! |
| 87 | |
| 88 | ) ELSE IF "%PROFILE:~0,4%" == "CYGW" ( |
| 89 | |
| 90 | SET CYGWINROOT=C:\cygwin |
| 91 | IF "%PLATFORM%" == "x64" (SET CYGWINROOT=!CYGWINROOT!64) |
| 92 | |
| 93 | SET BASH=!CYGWINROOT!\bin\bash.exe |
| 94 | SET SETUP=!CYGWINROOT!\setup-x86 |
| 95 | IF "%PLATFORM%" == "x64" (SET SETUP=!SETUP!_64) |
| 96 | SET SETUP=!SETUP!.exe |
| 97 | |
| 98 | SET BUILDDIR=%BUILDDIR:\=/% |
| 99 | SET BUILDDIR=/cygdrive/c!BUILDDIR:~2! |
| 100 | SET INSTDIR=%INSTDIR:\=/% |
| 101 | SET INSTDIR_CYG=/cygdrive/c!INSTDIR:~2! |
| 102 | SET SRCDIR=%SRCDIR:\=/% |
| 103 | SET SRCDIR=/cygdrive/c!SRCDIR:~2! |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 104 | |
| 105 | ) |
| 106 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 107 | GOTO :EOF |
| 108 | |
| 109 | :SETUPNEWERMSVC |
James E. King III | 278528c | 2019-01-11 12:17:44 -0500 | [diff] [blame^] | 110 | :: If VsDevCmd.bat has already executed, as is the case in the |
| 111 | :: msvc2017 docker container, skip this... |
| 112 | IF NOT DEFINED VSCMD_VER ( |
| 113 | FOR /F "USEBACKQ TOKENS=*" %%i IN (`call "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -version "[15.0,16.0)" -property installationPath`) DO ( |
| 114 | IF "%MSVCROOT%" == "" (SET MSVCROOT=%%i) |
| 115 | ) |
| 116 | SET MSVCPLAT=x86 |
| 117 | IF "%PLATFORM%" == "x64" (SET MSVCPLAT=amd64) |
| 118 | |
| 119 | SET CURRENTDIR=%CD% |
| 120 | CALL "!MSVCROOT!\Common7\Tools\VsDevCmd.bat" -arch=!MSVCPLAT! || EXIT /B |
| 121 | CD %CURRENTDIR% |
| 122 | EXIT /B |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 123 | ) |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 124 | :EOF |