Skip to content

Commit ba68734

Browse files
authored
Merge pull request #18 from huangjj27/master
add AppVeyor CI
2 parents a3c1950 + aa26bbe commit ba68734

File tree

2 files changed

+79
-2
lines changed

2 files changed

+79
-2
lines changed

appveyor.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
image: Visual Studio 2017
2+
environment:
3+
RUSTFLAGS: -Ctarget-feature=+crt-static
4+
matrix:
5+
- TARGET: x86_64-pc-windows-msvc
6+
ALLOW_PR: 1
7+
- TARGET: i686-pc-windows-msvc
8+
BUILD_MSI: 1
9+
ALLOW_PR: 1
10+
- TARGET: i686-pc-windows-gnu
11+
MINGW_DIR: mingw32
12+
ALLOW_PR: 1
13+
- TARGET: x86_64-pc-windows-gnu
14+
MINGW_DIR: mingw64
15+
ALLOW_PR: 1
16+
access_token:
17+
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
18+
branches:
19+
only:
20+
- master
21+
- auto
22+
23+
install:
24+
# If this is a PR and we're not allowed to test PRs, skip the whole build.
25+
# Also if we're on the master branch no need to run the full test suite, so
26+
# just do a smoke test.
27+
- if defined APPVEYOR_PULL_REQUEST_NUMBER if NOT defined ALLOW_PR appveyor exit
28+
- if "%APPVEYOR_REPO_BRANCH%" == "master" if NOT defined ALLOW_PR appveyor exit
29+
30+
# Install MSYS2 and MINGW (32-bit & 64-bit)
31+
- ps: |
32+
# Check if MSYS2 was restored from cache
33+
if($env:MINGW_DIR) {
34+
if($env:MINGW_DIR -eq "mingw32") {
35+
# Download and install MINGW (32-bit)
36+
Write-Host "Installing MinGW (32-bit)..." -ForegroundColor Cyan
37+
Write-Host "Downloading installation package..."
38+
appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z -FileName mingw.7z
39+
} elseif($env:MINGW_DIR -eq "mingw64") {
40+
# Download and install MINGW (64-bit)
41+
Write-Host "Installing MinGW (64-bit)..." -ForegroundColor Cyan
42+
Write-Host "Downloading installation package..."
43+
appveyor-retry appveyor DownloadFile https://s3.amazonaws.com/rust-lang-ci/x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z -FileName mingw.7z
44+
}
45+
Write-Host "Extracting installation package..."
46+
7z x -y mingw.7z -oC:\msys64 | Out-Null
47+
del mingw.7z
48+
} else {
49+
Write-Host "MSYS2 not required" -ForegroundColor Green
50+
}
51+
52+
# Install rust, x86_64-pc-windows-msvc host
53+
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
54+
- rustup-init.exe -y --default-host=x86_64-pc-windows-msvc
55+
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
56+
57+
# Install the target we're compiling for
58+
- if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET%
59+
60+
# add mingw to PATH if necessary
61+
- if defined MINGW_DIR set PATH=C:\msys64\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
62+
63+
# set cargo features for MSI if requested (otherwise empty string)
64+
- set FEATURES=
65+
- if defined BUILD_MSI set FEATURES=--features msi-installed
66+
67+
# let's see what we got
68+
- where gcc rustc cargo
69+
- rustc -vV
70+
- cargo -vV
71+
72+
build: false
73+
74+
test_script:
75+
- cd ui-sys
76+
- cargo build --verbose --tests --examples
77+
- cd ../iui
78+
- cargo build --verbose --tests --examples # make sure all examples can be build.

ui-sys/build.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ fn main() {
4444
.expect("Unable to retrieve current directory location.");
4545
dst.push("lib");
4646
}
47-
48-
47+
4948
let libname;
5049
if msvc {
5150
libname = "libui";

0 commit comments

Comments
 (0)