]>
git.proxmox.com Git - libgit2.git/blob - azure-pipelines/build.sh
3 # Environment variables:
5 # SOURCE_DIR: Set to the directory of the libgit2 source (optional)
6 # If not set, it will be derived relative to this script.
10 SOURCE_DIR
=${SOURCE_DIR:-$( cd "$( dirname "${BASH_SOURCE[0]}" )" && dirname $( pwd ) )}
12 BUILD_PATH
=${BUILD_PATH:=$PATH}
14 CMAKE_GENERATOR
=${CMAKE_GENERATOR:-Unix Makefiles}
16 if [[ "$(uname -s)" == MINGW
* ]]; then
17 BUILD_PATH
=$
(cygpath
"$BUILD_PATH")
20 indent
() { sed "s/^/ /"; }
22 echo "Source directory: ${SOURCE_DIR}"
23 echo "Build directory: ${BUILD_DIR}"
26 if [ "$(uname -s)" = "Darwin" ]; then
31 if [ -f "/etc/debian_version" ]; then
32 echo "Debian version:"
33 (source /etc
/lsb-release
&& echo "${DISTRIB_DESCRIPTION}") | indent
36 echo "Kernel version:"
37 uname
-a 2>&1 | indent
40 env PATH
="${BUILD_PATH}" "${CMAKE}" --version 2>&1 | indent
42 if test -n "${CC}"; then
43 echo "Compiler version:"
44 "${CC}" --version 2>&1 | indent
47 if test -n "${CC}"; then
48 echo "CC=${CC}" | indent
50 if test -n "${CFLAGS}"; then
51 echo "CFLAGS=${CFLAGS}" | indent
55 echo "##############################################################################"
56 echo "## Configuring build environment"
57 echo "##############################################################################"
59 echo cmake
-DENABLE_WERROR=ON
-DBUILD_EXAMPLES=ON
-DBUILD_FUZZERS=ON
-DUSE_STANDALONE_FUZZERS=ON
-G \"${CMAKE_GENERATOR}\" ${CMAKE_OPTIONS} -S \"${SOURCE_DIR}\"
60 env PATH
="${BUILD_PATH}" "${CMAKE}" -DENABLE_WERROR=ON -DBUILD_EXAMPLES=ON -DBUILD_FUZZERS=ON -DUSE_STANDALONE_FUZZERS=ON -G "${CMAKE_GENERATOR}" ${CMAKE_OPTIONS} -S "${SOURCE_DIR}"
63 echo "##############################################################################"
64 echo "## Building libgit2"
65 echo "##############################################################################"
67 env PATH
="${BUILD_PATH}" "${CMAKE}" --build .