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 | |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 17 | :: PLATFORM is x86 or x64 |
| 18 | :: NORM_PLATFORM is 32 or 64 |
| 19 | :: MSVCPLAT is x86 or amd64 |
| 20 | IF "%PLATFORM%" == "x86" ( |
| 21 | SET NORM_PLATFORM=32 |
| 22 | ) ELSE ( |
| 23 | SET NORM_PLATFORM=64 |
| 24 | ) |
| 25 | IF "%PLATFORM%" == "x86" ( |
| 26 | SET MSVCPLAT=x86 |
| 27 | ) ELSE ( |
| 28 | SET MSVCPLAT=amd64 |
| 29 | ) |
| 30 | |
| 31 | IF "%PROFILE%" == "MSVC2015" ( |
| 32 | IF "%PLATFORM%" == "x86" ( |
| 33 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 || EXIT /B |
| 34 | ) ELSE ( |
| 35 | CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 || EXIT /B |
| 36 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64 || EXIT /B |
| 37 | ) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 38 | ) ELSE IF "%PROFILE%" == "MSVC2017" ( |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 39 | IF "%PLATFORM%" == "x86" ( |
| 40 | CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat" || EXIT /B |
| 41 | ) ELSE ( |
| 42 | CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" || EXIT /B |
| 43 | ) |
| 44 | ) ELSE IF "%PROFILE%" == "MSVC2019" ( |
| 45 | IF "%PLATFORM%" == "x86" ( |
| 46 | CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars32.bat" || EXIT /B |
| 47 | ) ELSE ( |
| 48 | CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" || EXIT /B |
| 49 | ) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 50 | ) ELSE IF "%PROFILE%" == "MINGW" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 51 | REM Supported, nothing special to do here. |
| 52 | ) ELSE IF "%PROFILE%" == "CYGWIN" ( |
| 53 | REM Supported, nothing special to do here. |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 54 | ) ELSE ( |
| 55 | ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM% |
| 56 | EXIT /B 1 |
| 57 | ) |
| 58 | |
Mario Emmenlauer | 9e3ac85 | 2021-08-05 12:42:21 +0200 | [diff] [blame] | 59 | CALL win_setcompiler.bat || EXIT /B |
| 60 | CALL win_setgenerator.bat || EXIT /B |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 61 | |
| 62 | SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 63 | SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 64 | SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\install\%PROFILE%\%PLATFORM% |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 65 | SET SRCDIR=%APPVEYOR_BUILD_FOLDER% |
| 66 | |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 67 | |
Mario Emmenlauer | 22bb550 | 2021-08-05 15:40:19 +0200 | [diff] [blame^] | 68 | IF "%PROFILE_CLASS%" == "MSVC" ( |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 69 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 70 | :: FindBoost needs forward slashes so cmake doesn't see something as an escaped character |
| 71 | SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_% |
| 72 | SET BOOST_LIBRARYDIR=!BOOST_ROOT!/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.%COMPILER:~-1,1% |
| 73 | SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM% |
| 74 | SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty |
James E. King, III | 33df4eb | 2017-04-06 08:45:17 -0400 | [diff] [blame] | 75 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 76 | IF "%PYTHON_VERSION%" == "" ( |
| 77 | SET WITH_PYTHON=OFF |
| 78 | ) ELSE ( |
| 79 | SET WITH_PYTHON=ON |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 80 | IF /i "%PLATFORM%" == "x64" (SET PTEXT=-x64) |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 81 | SET PATH=C:\Python%PYTHON_VERSION:.=%!PTEXT!\scripts;C:\Python%PYTHON_VERSION:.=%!PTEXT!;!PATH! |
| 82 | ) |
| 83 | IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 84 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 85 | IF NOT "%QT_VERSION%" == "" ( |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 86 | IF /i "%PLATFORM%" == "x64" (SET QTEXT=_64) |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 87 | SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH! |
| 88 | ) |
| 89 | |
Mario Emmenlauer | 22bb550 | 2021-08-05 15:40:19 +0200 | [diff] [blame^] | 90 | ) ELSE IF "%PROFILE_CLASS%" == "MINGW" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 91 | |
| 92 | :: PLATFORM = x86 means MINGWPLAT i686 |
| 93 | :: PLATFORM = x64 means MINGWPLAT x86_64 |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 94 | IF "%PLATFORM%" == "x86" ( |
| 95 | SET MINGWPLAT=i686 |
| 96 | ) ELSE ( |
| 97 | SET MINGWPLAT=x86_64 |
| 98 | ) |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 99 | |
| 100 | SET BASH=C:\msys64\usr\bin\bash.exe |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 101 | !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] | 102 | |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 103 | SET BUILDDIR=%BUILDDIR:\=/% |
| 104 | SET BUILDDIR=/c!BUILDDIR:~2! |
| 105 | SET INSTDIR=%INSTDIR:\=/% |
| 106 | SET INSTDIR=/c!INSTDIR:~2! |
| 107 | SET SRCDIR=%SRCDIR:\=/% |
| 108 | SET SRCDIR=/c!SRCDIR:~2! |
| 109 | |
Mario Emmenlauer | 22bb550 | 2021-08-05 15:40:19 +0200 | [diff] [blame^] | 110 | ) ELSE IF "%PROFILE_CLASS%" == "CYGWIN" ( |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 111 | |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 112 | IF "%PLATFORM%" == "x64" ( |
| 113 | SET CYGWINROOT=C:\cygwin64 |
| 114 | ) ELSE ( |
| 115 | SET CYGWINROOT=C:\cygwin |
| 116 | ) |
| 117 | |
| 118 | IF "%PLATFORM%" == "x64" ( |
| 119 | SET SETUP=!CYGWINROOT!\setup-x86_64.exe |
| 120 | ) ELSE ( |
| 121 | SET SETUP=!CYGWINROOT!\setup-x86.exe |
| 122 | ) |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 123 | |
| 124 | SET BASH=!CYGWINROOT!\bin\bash.exe |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 125 | SET BUILDDIR=%BUILDDIR:\=/% |
| 126 | SET BUILDDIR=/cygdrive/c!BUILDDIR:~2! |
| 127 | SET INSTDIR=%INSTDIR:\=/% |
Mario Emmenlauer | ce64880 | 2021-08-05 17:10:09 +0200 | [diff] [blame] | 128 | SET INSTDIR=/cygdrive/c!INSTDIR:~2! |
James E. King III | 860a5f1 | 2018-03-06 14:23:23 -0500 | [diff] [blame] | 129 | SET SRCDIR=%SRCDIR:\=/% |
| 130 | SET SRCDIR=/cygdrive/c!SRCDIR:~2! |
James E. King, III | 07f5997 | 2017-03-10 06:18:33 -0500 | [diff] [blame] | 131 | |
| 132 | ) |