blob: e80d6b569ae9f973564f4f0c2982fe0ad5c52b02 [file] [log] [blame]
James E. King, III07f59972017-03-10 06:18:33 -05001::
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
15 IF "%PROFILE%" == "MSVC2010" (
16 CALL "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" %PLATFORM%
17) ELSE IF "%PROFILE%" == "MSVC2012" (
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, III19baeef2017-04-27 14:09:31 -040024 CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat" %PLATFORM%
James E. King, III07f59972017-03-10 06:18:33 -050025) ELSE IF "%PROFILE%" == "MINGW" (
26 SET MSYS2_PATH_TYPE=stock
27) ELSE IF "%PROFILE%" == "MSYS" (
28 SET MSYS2_PATH_TYPE=stock
29) ELSE (
30 ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM%
31 EXIT /B 1
32)
33
34CALL cl_setcompiler.bat || EXIT /B
35CALL cl_setgenerator.bat || EXIT /B
36
37SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor
38SET BUILDCACHE=%APPVEYOR_BUILD_FOLDER%\buildcache
39SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-build
40SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\local-thrift-inst
41SET SRCDIR=%APPVEYOR_BUILD_FOLDER%
42
James E. King, III33df4eb2017-04-06 08:45:17 -040043: PLATFORM is x64 or x86, but we want x86 to become "32" when we strip it down for paths:
44SET NORM_PLATFORM=%PLATFORM:~-2,2%
45IF "%NORM_PLATFORM%" == "86" (SET NORM_PLATFORM=32)
46
James E. King, III19baeef2017-04-27 14:09:31 -040047:: FindBoost needs forward slashes so cmake doesn't see something as an escaped character
48SET BOOST_ROOT=C:/Libraries/boost_%BOOST_VERSION:.=_%
49SET BOOST_LIBRARYDIR=%BOOST_ROOT%/lib%NORM_PLATFORM%-msvc-%COMPILER:~-3,2%.0
James E. King, III33df4eb2017-04-06 08:45:17 -040050SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM%
James E. King, III07f59972017-03-10 06:18:33 -050051SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty
James E. King, III33df4eb2017-04-06 08:45:17 -040052
53:: MSVC2010 doesn't "do" std::thread
54IF "%COMPILER%" == "vc100" (
55 SET THREADMODEL=BOOST
56) ELSE (
57 SET THREADMODEL=STD
58)
59
James E. King, III07f59972017-03-10 06:18:33 -050060IF "%PYTHON_VERSION%" == "" (
61 SET WITH_PYTHON=OFF
62) ELSE (
63 SET WITH_PYTHON=ON
64 SET PATH=C:\Python%PYTHON_VERSION:.=%\scripts;C:\Python%PYTHON_VERSION:.=%;!PATH!
65)
James E. King, III33df4eb2017-04-06 08:45:17 -040066IF "%CONFIGURATION%" == "Debug" (SET ZLIB_LIB_SUFFIX=d)
James E. King, III07f59972017-03-10 06:18:33 -050067
68IF NOT "%QT_VERSION%" == "" (
69 IF /i "%PLATFORM%" == "x64" SET QTEXT=_64
70 SET PATH=C:\Qt\%QT_VERSION%\%PROFILE%!QTEXT!\bin;!PATH!
71)
72
73IF NOT "%PROFILE:~0,4%" == "MSVC" (
74
75 SET BASH=C:\msys64\usr\bin\bash.exe
76 SET BOOST_ROOT=
77 SET BOOST_INCLUDEDIR=/mingw64/include
78 SET BOOST_LIBRARYDIR=/mingw64/lib
79 SET OPENSSL_LIBRARIES=/mingw64/lib
80 SET OPENSSL_ROOT=/mingw64
81 SET WIN3P=
82
83 !BASH! -lc "sed -i '/export PATH=\/mingw64\/bin/d' ~/.bash_profile && echo 'export PATH=/mingw64/bin:$PATH' >> ~/.bash_profile" || EXIT /B
84
85)
86
87SET BUILDDIR_MSYS=%BUILDDIR:\=/%
88SET BUILDDIR_MSYS=/c%BUILDDIR_MSYS:~2%
89SET INSTDIR_MSYS=%INSTDIR:\=/%
90SET INSTDIR_MSYS=/c%INSTDIR_MSYS:~2%
91SET SRCDIR_MSYS=%SRCDIR:\=/%
92SET SRCDIR_MSYS=/c%SRCDIR_MSYS:~2%