forked from intel/haxm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
76 lines (72 loc) · 3.35 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
language: c
matrix:
include:
- name: "haxm-darwin"
os: osx
addons:
homebrew:
packages:
- nasm
script:
- cd platforms/darwin
- xcodebuild -configuration Debug -sdk macosx
- name: "haxm-linux"
os: linux
dist: trusty
sudo: false
env:
- CHROOT=trusty_i386
- CHROOT_DIR=/tmp/chroot/${CHROOT}
before_install:
- sudo apt-get update
- sudo apt-get install -y linux-headers-`uname -r`
- wget -P /tmp/downloads http://mirrors.kernel.org/ubuntu/pool/universe/n/nasm/nasm_2.13.02-0.1_amd64.deb
- sudo apt-get install -y dpkg
- sudo dpkg -i /tmp/downloads/nasm_2.13.02-0.1_amd64.deb
# Cross-compiling to 32-bit Linux
- mkdir -p ${CHROOT_DIR}/haxm
- cp -r . ${CHROOT_DIR}/haxm
- sudo apt-get install -y debootstrap schroot
- |
( echo "[${CHROOT}]"
echo "type=directory"
echo "directory=${CHROOT_DIR}"
echo "personality=linux32"
echo "users=`id -un`"
echo "root-users=`id -un`"
) | sudo tee /etc/schroot/chroot.d/${CHROOT}.conf > /dev/null
- sudo debootstrap --variant=buildd --arch=i386 trusty ${CHROOT_DIR}
- schroot -c ${CHROOT} -u root -- sed -i "1p ; 1s| trusty | trusty-updates |" /etc/apt/sources.list
- schroot -c ${CHROOT} -u root -- apt update
- schroot -c ${CHROOT} -u root -- apt-cache search linux-header
- schroot -c ${CHROOT} -u root -- apt install -y linux-headers-`uname -r`
- wget -P /tmp/downloads http://mirrors.kernel.org/ubuntu/pool/universe/n/nasm/nasm_2.13.02-0.1_i386.deb
- schroot -c ${CHROOT} -u root -- apt install -y dpkg
- schroot -c ${CHROOT} -u root -- dpkg -i /tmp/downloads/nasm_2.13.02-0.1_i386.deb
script:
- cd platforms/linux
- make -j$(nproc)
# Cross-compiling to 32-bit Linux
- schroot -c ${CHROOT} --directory ${CHROOT_DIR}/haxm/platforms/linux -- make -j$(nproc)
- name: "haxm-windows"
os: windows
install:
- choco install -y nuget.commandline
- choco install -y windowsdriverkit10 --version 10.0.17763
- choco install -y windows-sdk-10.1 --version 10.1.17763.1
script:
- cd platforms/windows
- nuget restore
- export PATH="$PATH:/c/Program Files (x86)/Microsoft Visual Studio/Installer/"
- export MSVC=$(vswhere -latest -products "*" -requires Microsoft.Component.MSBuild -property installationPath)
- export MSVC=$(echo /$MSVC | sed -e 's/\\/\//g' -e 's/://')
- export PATH="$PATH:$MSVC/MSBuild/15.0/Bin/"
# TODO: Remove the following hack when no longer needed.
# NOTE: Officially WDK does not support VS Build Tools, only regular VS/EWDK installations,
# but since those are not supported by TravisCI, we need to install targets manually.
- unzip "/c/Program Files (x86)/Windows Kits/10/Vsix/WDK.vsix" -d wdk
- cp -R wdk/\$VCTargets/* "$MSVC/Common7/IDE/VC/VCTargets"
- export PROPS="//p:DefaultWindowsSDKVersion=10.0.17763.0 //p:SpectreMitigation=false"
- MSBuild.exe haxm.sln $PROPS //p:Configuration="Debug" //p:Platform="Win32"
- MSBuild.exe haxm.sln $PROPS //p:Configuration="Debug" //p:Platform="x64"
- build/tests/x64/Debug/haxm-tests.exe