blob: ceb4f5502f39b3f2525744a9896f937c99775f6e (
plain)
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
|
#!/bin/bash
REPO_ROOT="$(dirname "$(dirname "$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null && pwd -P)")")"
CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-RelWithDebInfo}"
# shellcheck source=./win-build-dir.sh
. "${REPO_ROOT}/packaging/windows/win-build-dir.sh"
set -exu -o pipefail
if [ -d "${build}" ]; then
rm -rf "${build}"
fi
generator="Unix Makefiles"
build_args="-j $(nproc)"
if command -v ninja >/dev/null 2>&1; then
generator="Ninja"
build_args="-k 1"
fi
COMMON_CFLAGS="-Wa,-mbig-obj -pipe -D_FILE_OFFSET_BITS=64 -D__USE_MINGW_ANSI_STDIO=1"
if [ "${CMAKE_BUILD_TYPE}" = "Debug" ]; then
BUILD_CFLAGS="-fstack-protector-all -O0 -ggdb -Wall -Wextra -Wno-char-subscripts -DNETDATA_INTERNAL_CHECKS=1 ${COMMON_CFLAGS} ${CFLAGS:-}"
else
BUILD_CFLAGS="-O2 ${COMMON_CFLAGS} ${CFLAGS:-}"
fi
${GITHUB_ACTIONS+echo "::group::Configuring"}
# shellcheck disable=SC2086
CFLAGS="${BUILD_CFLAGS}" /usr/bin/cmake \
-S "${REPO_ROOT}" \
-B "${build}" \
-G "${generator}" \
-DCMAKE_INSTALL_PREFIX="/opt/netdata" \
-DBUILD_FOR_PACKAGING=On \
-DNETDATA_USER="${USER}" \
-DENABLE_ACLK=On \
-DENABLE_CLOUD=On \
-DENABLE_H2O=Off \
-DENABLE_ML=On \
-DENABLE_PLUGIN_GO=On \
-DENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE=Off \
-DENABLE_BUNDLED_JSONC=On \
-DENABLE_BUNDLED_PROTOBUF=Off \
${EXTRA_CMAKE_OPTIONS:-}
${GITHUB_ACTIONS+echo "::endgroup::"}
${GITHUB_ACTIONS+echo "::group::Building"}
# shellcheck disable=SC2086
cmake --build "${build}" -- ${build_args}
${GITHUB_ACTIONS+echo "::endgroup::"}
if [ -t 1 ]; then
echo
echo "Compile with:"
echo "cmake --build \"${build}\""
fi
|