forked from dlang/dmd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.sh
83 lines (65 loc) · 2.39 KB
/
appveyor.sh
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
77
78
79
80
81
82
83
#!/bin/sh
set -e -v
clone() {
local url="$1"
local path="$2"
local branch="$3"
for i in {0..4}; do
if git clone --branch "$branch" "$url" "$path" "${@:4}" --quiet; then
break
elif [ $i -lt 4 ]; then
sleep $((1 << $i))
else
echo "Failed to clone: ${url}"
exit 1
fi
done
}
echo "C_COMPILER: $C_COMPILER"
echo "D_COMPILER: $D_COMPILER"
echo "D_VERSION: $D_VERSION"
cd /c/projects/
if [ ! -f "gnumake/make.exe" ]; then
mkdir gnumake
cd gnumake
appveyor DownloadFile "https://ftp.gnu.org/gnu/make/make-4.2.tar.gz" -FileName make.tar.gz
7z x make.tar.gz -so | 7z x -si -ttar > /dev/null
cd make-4.2
# usr/bin/link overriding VS's link.exe, give priority to VS's in PATH
export PATH="/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/amd64/:$PATH"
./build_w32.bat > /dev/null
cp WinRel/gnumake.exe ../make.exe
cd ../..
gnumake/make.exe --version
fi
if [ $D_COMPILER == "dmd" ]; then
#appveyor DownloadFile "http://downloads.dlang.org/releases/2.x/${D_VERSION}/dmd.${D_VERSION}.windows.7z" -FileName dmd2.7z
appveyor DownloadFile "http://nightlies.dlang.org/dmd-master-2017-12-22/dmd.master.windows.7z" -FileName dmd2.7z
7z x dmd2.7z > /dev/null
export PATH=$PWD/dmd2/windows/bin/:$PATH
export DMD=/c/projects/dmd2/windows/bin/dmd.exe
dmd --version
fi
for proj in druntime phobos; do
if [ $APPVEYOR_REPO_BRANCH != master ] && [ $APPVEYOR_REPO_BRANCH != stable ] &&
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $APPVEYOR_REPO_BRANCH > /dev/null; then
# use master as fallback for other repos to test feature branches
clone https://github.com/dlang/$proj.git $proj master
else
clone https://github.com/dlang/$proj.git $proj $APPVEYOR_REPO_BRANCH
fi
done
# build via makefile
cd /c/projects/dmd/src
make -f win64.mak reldmd DMD=../src/dmd
cd /c/projects/druntime
make -f win64.mak DMD=../dmd/src/dmd
cd /c/projects/phobos
make -f win64.mak DMD=../dmd/src/dmd
cp /c/projects/phobos/phobos64.lib /c/projects/dmd/
export OS="Win_64"
export CC='c:/"Program Files (x86)"/"Microsoft Visual Studio 14.0"/VC/bin/amd64/cl.exe'
export MODEL="64"
export MODEL_FLAG="-m64"
cd /c/projects/dmd/test
../../gnumake/make -j3 all MODEL=$MODEL ARGS="-O -inline -g" MODEL_FLAG=$MODEL_FLAG LIB="../../phobos;$LIB"