Skip to content

Commit 44b294c

Browse files
committed
Merge pull request #1 from alexcrichton/fix-windows
Fix linkage errors on appveyor
2 parents de07431 + 7943431 commit 44b294c

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

.appveyor.cargo-config.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[target.x86_64-pc-windows-msvc.openssl]
2+
rustc-link-search = ['native=C:\OpenSSL\openssl-1.0.2d-vs2015\lib64']
3+
rustc-link-lib = ['static=ssleay32MT', 'static=libeay32MT', 'gdi32', 'user32']
4+
include = 'C:\OpenSSL\openssl-1.0.2d-vs2015\include'
5+
6+
[target.i686-pc-windows-msvc.openssl]
7+
rustc-link-search = ['native=C:\OpenSSL\openssl-1.0.2d-vs2015\lib']
8+
rustc-link-lib = ['static=ssleay32MT', 'static=libeay32MT', 'gdi32', 'user32']
9+
include = 'C:\OpenSSL\openssl-1.0.2d-vs2015\include'
10+
11+
[target.x86_64-pc-windows-gnu.openssl]
12+
rustc-link-search = ['native=C:\msys64\mingw64\lib']
13+
rustc-link-lib = ['static=ssl', 'static=crypto', 'gdi32', 'user32']
14+
include = 'C:\msys64\mingw64\include'
15+
16+
[target.i686-pc-windows-gnu.openssl]
17+
rustc-link-search = ['native=C:\msys64\mingw32\lib']
18+
rustc-link-lib = ['static=ssl', 'static=crypto', 'gdi32', 'user32']
19+
include = 'C:\msys64\mingw32\include'

appveyor.yml

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
environment:
22
matrix:
33
- TARGET: x86_64-pc-windows-msvc
4-
BITS: 64
54
- TARGET: i686-pc-windows-msvc
6-
BITS: 32
75
- TARGET: x86_64-pc-windows-gnu
86
BITS: 64
97
- TARGET: i686-pc-windows-gnu
@@ -16,69 +14,52 @@ install:
1614
Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" -FileName "rust-nightly.exe"
1715
.\rust-nightly.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null
1816
$env:PATH="$env:PATH;C:\rust\bin"
19-
20-
# OpenSSL must be linked statically
21-
$env:OPENSSL_STATIC="1"
22-
17+
18+
New-Item .cargo -type directory
19+
Copy-Item .appveyor.cargo-config.toml .cargo/config
20+
2321
# For -gnu builds
2422
if ($env:TARGET -match "-gnu$") {
2523
$env:PATH="$env:PATH;C:\msys64\mingw${env:BITS}\bin"
26-
$env:OPENSSL_INCLUDE_DIR="C:\msys64\mingw${env:BITS}\include"
27-
$env:OPENSSL_LIB_DIR="C:\msys64\mingw${env:BITS}\lib"
28-
$env:OPENSSL_LIBS="crypto:ssl"
2924
}
30-
25+
3126
# For -msvc builds
3227
if ($env:TARGET -match "-msvc$") {
33-
# Install OpenSSL
3428
Start-FileDownload "http://www.npcglib.org/~stathis/downloads/openssl-1.0.2d-vs2015.7z" -FileName "openssl.7z"
35-
7z x openssl.7z -o"C:\OpenSSL"
36-
37-
$env:OPENSSL_INCLUDE_DIR="C:\OpenSSL\openssl-1.0.2d-vs2015\include"
38-
if ($env:BITS -eq "32") {
39-
$env:OPENSSL_LIB_DIR="C:\OpenSSL\openssl-1.0.2d-vs2015\lib"
40-
} else {
41-
$env:OPENSSL_LIB_DIR="C:\OpenSSL\openssl-1.0.2d-vs2015\lib64"
42-
}
43-
$env:OPENSSL_LIBS="ssleay32MT:libeay32MT"
29+
7z x openssl.7z -o"C:\OpenSSL" | Out-Null
4430
}
45-
31+
4632
# Print version info
4733
rustc -vV
4834
cargo -vV
49-
35+
5036
# Configure git
5137
git config --global user.email "[email protected]"
5238
git config --global user.name "Diggory Blake (via Appveyor CI)"
5339
git config --global push.default simple
5440
55-
build_script:
56-
- ps: |
57-
if ($env:TARGET -match "-gnu$") {
58-
cargo rustc --release --bin multirust-rs -- -C link-args="-lgdi32 -luser32"
59-
}
60-
if ($env:TARGET -match "-msvc$") {
61-
cargo rustc --release --bin multirust-rs -- -C link-args="gdi32.lib user32.lib"
62-
}
63-
# Generate hashes
64-
Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
41+
build: false
6542
test_script:
66-
- cargo test --verbose
67-
- cargo test -p rust-install --verbose
68-
- cargo test -p rust-manifest --verbose
43+
- cargo test
44+
- cargo test -p rust-install
45+
- cargo test -p rust-manifest
6946
- tests\cli.bat
7047
notifications:
7148
- provider: Webhook
7249
url: https://webhooks.gitter.im/e/9907ad94eb7a5ff291c3
7350
on_success:
7451
- ps: |
7552
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER) {
53+
cargo build --release
54+
# Generate hashes
55+
Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
56+
7657
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
7758
$bin = "binaries\$env:TARGET"
7859
} else {
7960
$bin = "binaries\$env:APPVEYOR_REPO_BRANCH\$env:TARGET"
8061
}
81-
62+
8263
cmd /c "git config --global credential.helper store 2>&1"
8364
Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:access_token):[email protected]`n"
8465
cmd /c "git submodule init 2>&1"

0 commit comments

Comments
 (0)