]> git.proxmox.com Git - ceph.git/blob - ceph/src/seastar/fmt/support/appveyor-build.py
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / seastar / fmt / support / appveyor-build.py
1 #!/usr/bin/env python
2 # Build the project on AppVeyor.
3
4 import os
5 from subprocess import check_call
6
7 build = os.environ['BUILD']
8 config = os.environ['CONFIGURATION']
9 platform = os.environ['PLATFORM']
10 path = os.environ['PATH']
11 image = os.environ['APPVEYOR_BUILD_WORKER_IMAGE']
12 jobid = os.environ['APPVEYOR_JOB_ID']
13 cmake_command = ['cmake', '-DFMT_PEDANTIC=ON', '-DCMAKE_BUILD_TYPE=' + config, '..']
14 if build == 'mingw':
15 cmake_command.append('-GMinGW Makefiles')
16 build_command = ['mingw32-make', '-j4']
17 test_command = ['mingw32-make', 'test']
18 # Remove the path to Git bin directory from $PATH because it breaks
19 # MinGW config.
20 path = path.replace(r'C:\Program Files (x86)\Git\bin', '')
21 os.environ['PATH'] = r'C:\MinGW\bin;' + path
22 else:
23 # Add MSBuild 14.0 to PATH as described in
24 # http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc.
25 os.environ['PATH'] = r'C:\Program Files (x86)\MSBuild\15.0\Bin;' + path
26 if image == 'Visual Studio 2013':
27 generator = 'Visual Studio 12 2013'
28 elif image == 'Visual Studio 2015':
29 generator = 'Visual Studio 14 2015'
30 elif image == 'Visual Studio 2017':
31 generator = 'Visual Studio 15 2017'
32 if platform == 'x64':
33 generator += ' Win64'
34 cmake_command.append('-G' + generator)
35 build_command = ['cmake', '--build', '.', '--config', config, '--', '/m:4']
36 test_command = ['ctest', '-C', config]
37
38 check_call(cmake_command)
39 check_call(build_command)
40 check_call(test_command)