From 2ced92529dc86db3706fa2d164de722ed3d33cec Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 12 Feb 2015 15:34:38 -0800 Subject: [PATCH] Move logic from travis.yml to a Python script --- appveyor.yml | 37 +++++++++++++++---------------------- support/build.py | 13 +++++++++++++ 2 files changed, 28 insertions(+), 22 deletions(-) create mode 100755 support/build.py diff --git a/appveyor.yml b/appveyor.yml index 5d472999..7a6c2a57 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,49 +1,42 @@ environment: CTEST_OUTPUT_ON_FAILURE: 1 matrix: - - Build: msvc - Config: Debug - - Build: msvc - Config: Release - - Build: mingw - Config: Debug - - Build: mingw - Config: Release + - BUILD: msvc + CONFIG: Debug + - BUILD: msvc + CONFIG: Release + - BUILD: mingw + CONFIG: Debug + - BUILD: mingw + CONFIG: Release install: - ps: | - if ($env:Build -eq "mingw") { + if ($env:BUILD -eq "mingw") { # Install MinGW. $url = "http://sourceforge.net/projects/mingw-w64/files/" - $url += "Toolchains%20targetting%20Win64/Personal%20Builds/" + $url += "Toolchains%20targetting%20Win64/Personal%20BUILDs/" $url += "mingw-builds/4.9.0/threads-win32/seh/" $url += "x86_64-4.9.0-release-win32-seh-rt_v3-rev2.7z/download" Invoke-WebRequest -UserAgent wget -Uri $url -OutFile mingw.7z &7z x -oC:\ mingw.7z > $null } - - set PATH=C:\Program Files (x86)\MSBuild\12.0\bin\;%PATH%;C:\mingw64\bin + - set PATH=C:\Program Files (x86)\MSBUILD\12.0\bin\;%PATH%;C:\mingw64\bin before_build: - - ps: | - if ($env:Build -eq "mingw") { - # Remove path to Git bin directory from PATH because it breaks MinGW config. - $env:PATH = $env:PATH -replace "C:\\Program Files \(x86\)\\Git\\bin","" - $generator = "-GMinGW Makefiles" - } - - echo "-DCMAKE_BUILD_TYPE=$env:Config" - - cmake -DFMT_EXTRA_TESTS=ON "-DCMAKE_BUILD_TYPE=$env:Config" "$generator" . + - python support/build.py build_script: - ps: | - if ($env:Build -eq "mingw") { + if ($env:BUILD -eq "mingw") { mingw32-make -j4 } else { - msbuild /m:4 /p:Config=$env:Config FORMAT.sln + msbuild /m:4 /p:Config=$env:CONFIG FORMAT.sln } test_script: - ps: | - if ($env:Build -eq "mingw") { + if ($env:BUILD -eq "mingw") { mingw32-make test } else { msbuild RUN_TESTS.vcxproj diff --git a/support/build.py b/support/build.py new file mode 100755 index 00000000..826e1527 --- /dev/null +++ b/support/build.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +# Build the project on AppVeyor. + +from subprocess import check_call +import os + +env = os.environ +build = env['BUILD'] +if build == 'mingw': + # Remove path to Git bin directory from $PATH because it breaks MinGW config. + env['PATH'] = env['PATH'].replace(r'C:\Program Files (x86)\Git\bin', '') + generator = ['-GMinGW Makefiles'] +check_call(['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + env['CONFIG']] + generator, env=env)