85 lines
2.4 KiB
Bash
Executable File
85 lines
2.4 KiB
Bash
Executable File
#!/bin/bash
|
|
_build_helper_dir="$(pwd)/build-helpers"
|
|
|
|
_build_type="Debug"
|
|
if [[ -n "${params.build_type}" ]]; then
|
|
echo "This is an automated jenkins build. Initializing variables."
|
|
|
|
if [[ "${params.build_type}" == "debug" ]]; then
|
|
echo "Initializing debug session."
|
|
export _build_type="Debug"
|
|
# shellcheck disable=SC2089
|
|
export TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME=\"beta\""
|
|
elif [[ "${params.build_type}" == "optimized" ]]; then
|
|
echo "Initializing optimized session."
|
|
export _build_type="RelWithDebInfo"
|
|
# shellcheck disable=SC2089
|
|
export TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=1 -DBUILD_TYPE_NAME=\"beta\""
|
|
elif [[ "${params.build_type}" == "stable" ]]; then
|
|
echo "Initializing stable session."
|
|
export _build_type="RelWithDebInfo"
|
|
# shellcheck disable=SC2089
|
|
export TEASPEAK_DEPLOY_TYPE_SPECIFIER="-DBUILD_TYPE=0 -DBUILD_TYPE_NAME=\"\""
|
|
|
|
else
|
|
echo "Unknown target build type: ${params.build_type}"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
|
|
# shellcheck disable=SC2154
|
|
if [[ "$no_web" == "1" ]]; then
|
|
echo "Disabling web support"
|
|
_web_flag="OFF"
|
|
else
|
|
_web_flag="ON"
|
|
fi
|
|
|
|
cd TeaSpeak || exit 1
|
|
if [[ -d build ]]; then
|
|
rm -r build
|
|
fi
|
|
mkdir build || exit 1
|
|
cd build || exit 1
|
|
|
|
echo "Build type: $_build_type"
|
|
cmake .. -DCMAKE_BUILD_TYPE="$_build_type" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" -DBUILD_INCLUDE_FILE="$_build_helper_dir"/cmake/config/tearoot-server.cmake -DCMAKE_MODULE_PATH="$_build_helper_dir"/cmake/ -DDISABLE_QT=1 -DDISABLE_CUSTOM_OUTPUT=ON -DDISABLE_QT=ON -DCOMPILE_WEB_CLIENT="$_web_flag" $TEASPEAK_DEPLOY_TYPE_SPECIFIER
|
|
_code=$?
|
|
if [[ $_code -ne 0 ]]; then
|
|
echo "Failed to run CMAKE project"
|
|
exit 1
|
|
fi
|
|
|
|
cmake --build "$(pwd)" --target ProviderFFMpeg -- -j 12; _code=$?
|
|
if [[ $_code -ne 0 ]]; then
|
|
echo "Failed to build ffmpeg ($_code)"
|
|
exit 1
|
|
fi
|
|
cmake --build "$(pwd)" --target ProviderYT -- -j 12; _code=$?
|
|
if [[ $_code -ne 0 ]]; then
|
|
echo "Failed to build YT ($_code)"
|
|
exit 1
|
|
fi
|
|
|
|
cmake --build "$(pwd)" --target TeaSpeakServer -- -j 12; _code=$?
|
|
if [[ $_code -ne 0 ]]; then
|
|
echo "Failed to build server ($_code)"
|
|
exit 1
|
|
fi
|
|
|
|
#${CXX_FLAGS}
|
|
#${C_FLAGS}
|
|
|
|
#CMake specific
|
|
#${CMAKE_OPTIONS}
|
|
#${CMAKE_MAKE_OPTIONS}
|
|
|
|
#Make specific (without cmake)
|
|
#${MAKE_OPTIONS}
|
|
|
|
|
|
#CXXFLAGS="${CXX_FLAGS}" CFLAGS="${C_FLAGS}"
|
|
#CXXFLAGS="${CXX_FLAGS}" CFLAGS="${C_FLAGS}" ${CMAKE_OPTIONS}
|
|
|