]> git.proxmox.com Git - libgit2.git/blob - ci/build.sh
New upstream version 0.28.4+dfsg.1
[libgit2.git] / ci / build.sh
1 #!/usr/bin/env bash
2 #
3 # Environment variables:
4 #
5 # SOURCE_DIR: Set to the directory of the libgit2 source (optional)
6 # If not set, it will be derived relative to this script.
7
8 set -e
9
10 SOURCE_DIR=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
11 BUILD_DIR=$(pwd)
12 CC=${CC:-cc}
13
14 indent() { sed "s/^/ /"; }
15
16 echo "Source directory: ${SOURCE_DIR}"
17 echo "Build directory: ${BUILD_DIR}"
18 echo ""
19
20 if [ "$(uname -s)" = "Darwin" ]; then
21 echo "macOS version:"
22 sw_vers | indent
23 fi
24
25 if [ -f "/etc/debian_version" ]; then
26 echo "Debian version:"
27 lsb_release -a | indent
28 fi
29
30 echo "Kernel version:"
31 uname -a 2>&1 | indent
32
33 echo "CMake version:"
34 cmake --version 2>&1 | indent
35 echo "Compiler version:"
36 $CC --version 2>&1 | indent
37 echo ""
38
39 echo "##############################################################################"
40 echo "## Configuring build environment"
41 echo "##############################################################################"
42
43 echo cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON ${CMAKE_OPTIONS}
44 cmake ${SOURCE_DIR} -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON ${CMAKE_OPTIONS}
45
46 echo ""
47 echo "##############################################################################"
48 echo "## Building libgit2"
49 echo "##############################################################################"
50
51 cmake --build .