forked from llvm-hs/llvm-hs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
71 lines (64 loc) · 2.78 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
language: c
dist: xenial
cache:
directories:
- $HOME/.cabal/packages
- $HOME/.cabal/store
- $HOME/llvm-build-$LLVM_VER
- $HOME/llvm-src-$LLVM_VER
before_cache:
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/build-reports.log
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.tar
# remove files that are regenerated by 'cabal update'
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/00-index.*
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/*.json
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.cache
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar
- rm -fv $HOME/.cabal/packages/hackage.haskell.org/01-index.tar.idx
env:
global:
- LLVM_VER=12.0.0
matrix:
include:
- compiler: "ghc-8.8.1"
addons: {apt: {packages: [ghc-ppa-tools,cabal-install-3.0,ghc-8.8.1,gcc,g++], sources: [hvr-ghc]}}
before_install:
# Prune path, see https://github.com/travis-ci/travis-ci/issues/5326
- export PATH="$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")"
- HC=${CC}
- HCPKG=${HC/ghc/ghc-pkg}
- unset CC
- env
- PATH=/opt/ghc/bin:/opt/ghc-ppa-tools/bin:$PATH
- PKGNAME='llvm-hs'
- export LD_LIBRARY_PATH=$HOME/llvm-build-${LLVM_VER}/lib:$LD_LIBRARY_PATH
- export PATH=$HOME/llvm-build-${LLVM_VER}/bin:$PATH
- mkdir -p $HOME/bin
- export PATH=$HOME/bin:$PATH
install:
- curl -L https://github.com/Kitware/CMake/releases/download/v3.19.7/cmake-3.19.7-Linux-x86_64.tar.gz | tar -xzf - -C $HOME
- export PATH=$HOME/cmake-3.19.7-Linux-x86_64/bin:$PATH
- curl -L https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip -o ninja-linux.zip
- unzip ninja-linux.zip -d $HOME/bin
- git clone https://github.com/llvm/llvm-project -b release/12.x --single-branch --depth 1
- cd llvm-project/llvm
- mkdir -p build && cd build
- cmake -Wno-dev -G "Ninja" .. -DCMAKE_{BUILD_TYPE=Release,CXX_FLAGS_RELEASE=-O0,INSTALL_PREFIX=$HOME/llvm-build-${LLVM_VER}} -DLLVM_{TARGETS_TO_BUILD="X86",ENABLE_PROJECTS="clang;",INCLUDE_{TOOLS=ON,EXAMPLES=OFF,TESTS=OFF,BENCHMARKS=OFF},ENABLE_BINDINGS=OFF,PARALLEL_LINK_JOBS=1,BUILD_LLVM_DYLIB=ON,LINK_LLVM_DYLIB=ON}
- cmake --build . --parallel --target install
- cd $TRAVIS_BUILD_DIR
- ln -s $HOME/llvm-build-${LLVM_VER}/bin/llvm-config $HOME/bin/llvm-config
- llvm-config --version
- gcc --version
- g++ --version
- cabal --version
- echo "$(${HC} --version) [$(${HC} --print-project-git-commit-id 2> /dev/null || echo '?')]"
- travis_retry cabal update -v
- sed -i.bak 's/^jobs:/-- jobs:/' ${HOME}/.cabal/config
- rm -fv cabal.project.local
- rm -rf .ghc.environment.*
- cabal new-configure --enable-tests
- cabal new-build -w ${HC} --dep -j2 all
script:
- cabal new-build -w ${HC} all
- cabal new-test -w ${HC} all
- cabal new-haddock -w ${HC} all