Skip to content

Commit

Permalink
[CI] Add rules for AppVeyor
Browse files Browse the repository at this point in the history
Related work item: Github #1
  • Loading branch information
Minmin Gong committed Nov 10, 2018
1 parent 68b28a9 commit 051988d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .appveyor.yml
@@ -0,0 +1,26 @@
version: '{branch}-{build}'

clone_depth: 5

platform:
- x64

environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

configuration:
- Release

install:
- mkdir c:\ninja && cd c:\ninja
- appveyor-retry appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip
- 7z x ninja-win.zip
- set PATH=C:\ninja;%PATH%

build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- python BuildAll.py ninja %PLATFORM% %CONFIGURATION%

test_script:
- Build\ninja-%PLATFORM%-%CONFIGURATION%\Bin\ShaderConductorTest.exe
8 changes: 5 additions & 3 deletions BuildAll.py
Expand Up @@ -5,7 +5,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import os, platform, subprocess, sys
import multiprocessing, os, platform, subprocess, sys

def FindProgramFilesFolder():
env = os.environ
Expand Down Expand Up @@ -84,11 +84,13 @@ def FindVS2017Folder(programFilesFolder):
os.chdir(buildDir)
buildDir = os.path.abspath(os.curdir)

parallel = multiprocessing.cpu_count()

cmd = "%sVCVARSALL.BAT %s && cd /d \"%s\"" % (vs2017Folder, vcOption, buildDir)
if (buildSys == "ninja"):
cmd += " && set CC=cl.exe && set CXX=cl.exe && cmake -G Ninja -DCMAKE_BUILD_TYPE:STRING=\"%s\" ../../ && ninja" % configuration
cmd += " && set CC=cl.exe && set CXX=cl.exe && cmake -G Ninja -DCMAKE_BUILD_TYPE:STRING=\"%s\" ../../ && ninja -j%d" % (configuration, parallel)
else:
cmd += " && cmake -G \"Visual Studio 15\" -T host=x64 -A %s ../../ && MSBuild ALL_BUILD.vcxproj /nologo /m:2 /v:m /p:Configuration=%s,Platform=%s" % (arch, configuration, arch)
cmd += " && cmake -G \"Visual Studio 15\" -T host=x64 -A %s ../../ && MSBuild ALL_BUILD.vcxproj /nologo /m:%d /v:m /p:Configuration=%s,Platform=%s" % (arch, parallel, configuration, arch)
subprocess.call(cmd)

os.chdir(originalDir)

0 comments on commit 051988d

Please sign in to comment.