A lot of fixes for the automatic build system

This commit is contained in:
WolverinDEV 2019-07-02 02:23:51 +02:00
parent a827a2d64d
commit dc9dc62b2b
23 changed files with 241 additions and 131 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
.idea/
out/

3
.gitmodules vendored
View File

@ -64,3 +64,6 @@
[submodule "third_party/jemalloc"]
path = third_party/jemalloc
url = https://github.com/jemalloc/jemalloc.git
[submodule "shared"]
path = shared
url = https://git.did.science/WolverinDEV/TeaSpeak-SharedLib.git

34
build_shared.sh Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env bash
# Enter third_party/ directory
cd $(dirname $0)
tearoot_cmake_config="`pwd`/cmake/config/tearoot-client.cmake"
tearoot_cmake_module="`pwd`/cmake/"
traroot_library="`pwd`/third_party"
shared_path="shared"
source scripts/build_helper.sh
begin_task "build_shared" "Building shared library"
requires_rebuild ${shared_path}
[[ $? -eq 0 ]] && {
end_task "build_shared" "Shared build finished"
exit 0
}
generate_build_path shared
echo "Build path: $build_path"
if [[ -d ${build_path} ]]; then
echo "Deleting old build folder"
rm -r ${build_path}
check_err_exit ${shared_path} "Failed to delete old build folder"
fi
#set(CMAKE_MODULE_PATH "C:/Users/WolverinDEV/TeaSpeak/cmake")
#include(${CMAKE_MODULE_PATH}/libraries_wolverin_lap.cmake)
cmake_build ${shared_path} -DCMAKE_MODULE_PATH="$tearoot_cmake_module" -DCMAKE_PLATFORM_INCLUDE="$tearoot_cmake_config" -DLIBRARY_PATH="$traroot_library" -DBUILD_TESTS=OFF
check_err_exit ${shared_path} "Failed to build TeaSpeak shared library!"
set_build_successful ${shared_path}
end_task "build_shared" "Shared build finished"

View File

@ -18,6 +18,10 @@
# breakpad_SOURCE_FILES The source files which have to be included.
# breakpad_HEADER_FIOLES Header files which might be included.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(breakpad_ROOT_DIR
NAMES src/client/minidump_file_writer.h src/common/language.h
HINTS ${breakpad_ROOT_DIR}
@ -53,7 +57,6 @@ else()
message(FATAL_ERROR "Unknown system")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(breakpad DEFAULT_MSG
breakpad_INCLUDE_DIR
)

View File

@ -18,29 +18,29 @@
# DataPipes_LIBRARIES_STATIC The DataPipes libraries.
# DataPipes_LIBRARIES_SHARED The DataPipes libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(DataPipes_ROOT_DIR
NAMES include/buffer.h include/pipeline.h CMakeLists.txt
HINTS ${DataPipes_ROOT_DIR}
HINTS ${DataPipes_ROOT_DIR} ${DataPipes_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(DataPipes_INCLUDE_DIR
NAMES pipes/pipeline.h pipes/buffer.h
HINTS ${DataPipes_ROOT_DIR}/out/win32/include/ ${DataPipes_ROOT_DIR}/out/win32_amd64/include/
HINTS ${DataPipes_ROOT_DIR}/include/
)
find_library(DataPipes_LIBRARIES_STATIC
NAMES DataPipes.lib libDataPipes.a
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${DataPipes_ROOT_DIR} ${DataPipes_ROOT_DIR}/build ${DataPipes_ROOT_DIR}/libs ${DataPipes_ROOT_DIR}/out/
HINTS ${DataPipes_ROOT_DIR} ${DataPipes_ROOT_DIR}/lib
)
find_library(DataPipes_LIBRARIES_SHARED
NAMES DataPipes.dll libDataPipes.so
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${DataPipes_ROOT_DIR} ${DataPipes_ROOT_DIR}/build ${DataPipes_ROOT_DIR}/libs ${DataPipes_ROOT_DIR}/out/
HINTS ${DataPipes_ROOT_DIR} ${DataPipes_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DataPipes DEFAULT_MSG
DataPipes_INCLUDE_DIR
)

View File

@ -18,31 +18,29 @@
# ed25519_LIBRARIES_STATIC The ed25519 libraries.
# ed25519_LIBRARIES_SHARED The ed25519 libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(ed25519_ROOT_DIR
NAMES include/ed25519.h CMakeLists.txt
HINTS ${ed25519_ROOT_DIR}
NAMES include/ed25519/ed25519
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/${BUILD_OUTPUT}
)
#This NEEDS a fix!
find_path(ed25519_INCLUDE_DIR
NAMES ed25519/ed25519.h
PATH_SUFFIXES include
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/build ${ed25519_ROOT_DIR}/libs ${ed25519_ROOT_DIR}/out/win32_amd64
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/include/
)
find_library(ed25519_LIBRARIES_STATIC
NAMES ed25519.lib ed25519.a
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/build ${ed25519_ROOT_DIR}/libs ${ed25519_ROOT_DIR}/out/
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/lib
)
find_library(ed25519_LIBRARIES_SHARED
NAMES ed25519.dll ed25519.so
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/build ${ed25519_ROOT_DIR}/libs ${ed25519_ROOT_DIR}/out/
HINTS ${ed25519_ROOT_DIR} ${ed25519_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ed25519 DEFAULT_MSG
ed25519_INCLUDE_DIR
)

View File

@ -18,30 +18,29 @@
# opus_LIBRARIES_STATIC The opus libraries.
# opus_LIBRARIES_SHARED The opus libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(opus_ROOT_DIR
NAMES include/opus/opus.h
HINTS ${opus_ROOT_DIR}
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(opus_INCLUDE_DIR
NAMES opus/opus.h opus/opus_defines.h
HINTS ${opus_ROOT_DIR}/include/
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/include/
)
find_library(opus_LIBRARIES_STATIC
NAMES opus.a opus.lib
PATH_SUFFIXES lib/
HINTS
${opus_ROOT_DIR}/lib
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/lib
)
find_library(opus_LIBRARIES_SHARED
NAMES opus.dll opus.so
PATH_SUFFIXES lib bin
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/build ${opus_ROOT_DIR}/libs ${opus_ROOT_DIR}/out/
HINTS ${opus_ROOT_DIR} ${opus_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(opus DEFAULT_MSG
opus_INCLUDE_DIR
)

View File

@ -18,30 +18,29 @@
# PortAudio_LIBRARIES_STATIC The PortAudio libraries.
# PortAudio_LIBRARIES_SHARED The PortAudio libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(PortAudio_ROOT_DIR
NAMES include/portaudio.h
HINTS ${PortAudio_ROOT_DIR}
HINTS ${PortAudio_ROOT_DIR} ${PortAudio_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(PortAudio_INCLUDE_DIR
NAMES portaudio.h
HINTS ${PortAudio_ROOT_DIR}/include/
HINTS ${PortAudio_ROOT_DIR} ${PortAudio_ROOT_DIR}/include/
)
find_library(PortAudio_LIBRARIES_STATIC
NAMES portaudio_static_x64.a portaudio_static_x64.lib
PATH_SUFFIXES lib/
HINTS
${PortAudio_ROOT_DIR}/lib
HINTS ${PortAudio_ROOT_DIR} ${PortAudio_ROOT_DIR}/lib
)
find_library(PortAudio_LIBRARIES_SHARED
NAMES portaudio_shared_x64.dll portaudio_shared_x64.so
PATH_SUFFIXES lib bin
HINTS ${PortAudio_ROOT_DIR} ${PortAudio_ROOT_DIR}/build ${PortAudio_ROOT_DIR}/libs ${PortAudio_ROOT_DIR}/out/
HINTS ${PortAudio_ROOT_DIR} ${PortAudio_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PortAudio DEFAULT_MSG
PortAudio_INCLUDE_DIR
)

View File

@ -18,34 +18,29 @@
# soxr_LIBRARIES_STATIC The soxr libraries.
# soxr_LIBRARIES_SHARED The soxr libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(soxr_ROOT_DIR
NAMES src/Definitions.h CMakeLists.txt
HINTS ${soxr_ROOT_DIR}
HINTS ${soxr_ROOT_DIR} ${soxr_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(soxr_INCLUDE_DIR
NAMES soxr.h
HINTS ${soxr_ROOT_DIR}/include/
HINTS ${soxr_ROOT_DIR} ${soxr_ROOT_DIR}/include/
)
find_library(soxr_LIBRARIES_STATIC
NAMES soxr.a soxr.lib
PATH_SUFFIXES lib/
HINTS
${soxr_ROOT_DIR}
${soxr_ROOT_DIR}/build
${soxr_ROOT_DIR}/libs
${soxr_ROOT_DIR}/out/
${soxr_ROOT_DIR}/cmake-build-release
HINTS ${soxr_ROOT_DIR} ${soxr_ROOT_DIR}/lib
)
find_library(soxr_LIBRARIES_SHARED
NAMES soxr.dll soxr.so
PATH_SUFFIXES lib bin
HINTS ${soxr_ROOT_DIR} ${soxr_ROOT_DIR}/build ${soxr_ROOT_DIR}/libs ${soxr_ROOT_DIR}/out/
HINTS ${soxr_ROOT_DIR} ${soxr_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(soxr DEFAULT_MSG
soxr_INCLUDE_DIR
)

View File

@ -18,29 +18,29 @@
# StringVariable_LIBRARIES_STATIC The StringVariable libraries.
# StringVariable_LIBRARIES_SHARED The StringVariable libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(StringVariable_ROOT_DIR
NAMES include/StringVariable.h CMakeLists.txt
HINTS ${StringVariable_ROOT_DIR}
HINTS ${StringVariable_ROOT_DIR} ${StringVariable_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(StringVariable_INCLUDE_DIR
NAMES StringVariable.h
HINTS ${StringVariable_ROOT_DIR}/include
HINTS ${StringVariable_ROOT_DIR} ${StringVariable_ROOT_DIR}/include/
)
find_library(StringVariable_LIBRARIES_STATIC
NAMES StringVariablesStatic.lib StringVariablesStatic.a
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${StringVariable_ROOT_DIR} ${StringVariable_ROOT_DIR}/build ${StringVariable_ROOT_DIR}/libs ${StringVariable_ROOT_DIR}/out/
HINTS ${StringVariable_ROOT_DIR} ${StringVariable_ROOT_DIR}/lib
)
find_library(StringVariable_LIBRARIES_SHARED
NAMES StringVariable.dll StringVariable.so
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${StringVariable_ROOT_DIR} ${StringVariable_ROOT_DIR}/build ${StringVariable_ROOT_DIR}/libs ${StringVariable_ROOT_DIR}/out/
HINTS ${StringVariable_ROOT_DIR} ${StringVariable_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(StringVariable DEFAULT_MSG
StringVariable_INCLUDE_DIR
)

View File

@ -18,6 +18,9 @@
# TeaSpeak_SharedLib_LIBRARIES_STATIC The TeaSpeak_SharedLib libraries.
# TeaSpeak_SharedLib_LIBRARIES_SHARED The TeaSpeak_SharedLib libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(TeaSpeak_SharedLib_ROOT_DIR
NAMES src/Definitions.h CMakeLists.txt
HINTS ${TeaSpeak_SharedLib_ROOT_DIR}
@ -46,7 +49,6 @@ find_library(TeaSpeak_SharedLib_LIBRARIES_SHARED
HINTS ${TeaSpeak_SharedLib_ROOT_DIR} ${TeaSpeak_SharedLib_ROOT_DIR}/build ${TeaSpeak_SharedLib_ROOT_DIR}/libs ${TeaSpeak_SharedLib_ROOT_DIR}/out/
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TeaSpeak_SharedLib DEFAULT_MSG
TeaSpeak_SharedLib_INCLUDE_DIR
)

View File

@ -18,31 +18,30 @@
# ThreadPool_LIBRARIES_STATIC The ThreadPool libraries.
# ThreadPool_LIBRARIES_SHARED The ThreadPool libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(ThreadPool_ROOT_DIR
NAMES include/ThreadPool.h CMakeLists.txt
HINTS ${ThreadPool_ROOT_DIR}
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/${BUILD_OUTPUT}
)
#This NEEDS a fix!
find_path(ThreadPool_INCLUDE_DIR
NAMES ThreadPool/ThreadPool.h
PATH_SUFFIXES include
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/build ${ThreadPool_ROOT_DIR}/libs ${ThreadPool_ROOT_DIR}/out/win32_amd64
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/include/
)
find_library(ThreadPool_LIBRARIES_STATIC
NAMES ThreadPoolStatic.lib ThreadPoolStatic.a
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/build ${ThreadPool_ROOT_DIR}/libs ${ThreadPool_ROOT_DIR}/out/
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/lib
)
find_library(ThreadPool_LIBRARIES_SHARED
NAMES ThreadPool.dll ThreadPool.so
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/build ${ThreadPool_ROOT_DIR}/libs ${ThreadPool_ROOT_DIR}/out/
HINTS ${ThreadPool_ROOT_DIR} ${ThreadPool_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ThreadPool DEFAULT_MSG
ThreadPool_INCLUDE_DIR
)

View File

@ -18,29 +18,29 @@
# TomCrypt_LIBRARIES_STATIC The TomCrypt libraries.
# TomCrypt_LIBRARIES_SHARED The TomCrypt libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(TomCrypt_ROOT_DIR
NAMES src/headers/tomcrypt.h makefile LICENSE
HINTS ${TomCrypt_ROOT_DIR}
HINTS ${TomCrypt_ROOT_DIR} ${TomCrypt_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(TomCrypt_INCLUDE_DIR
NAMES tomcrypt.h tomcrypt_cfg.h
HINTS ${TomCrypt_ROOT_DIR}/src/headers
HINTS ${TomCrypt_ROOT_DIR} ${TomCrypt_ROOT_DIR}/include/ ${TomCrypt_ROOT_DIR}/src/headers
)
find_library(TomCrypt_LIBRARIES_STATIC
NAMES libtomcrypt.lib libtomcrypt.a
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${TomCrypt_ROOT_DIR} ${TomCrypt_ROOT_DIR}/build ${TomCrypt_ROOT_DIR}/libs ${TomCrypt_ROOT_DIR}/out/
HINTS ${TomCrypt_ROOT_DIR} ${TomCrypt_ROOT_DIR}/lib
)
find_library(TomCrypt_LIBRARIES_SHARED
NAMES libtomcrypt.dll libtomcrypt.so
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${TomCrypt_ROOT_DIR} ${TomCrypt_ROOT_DIR}/build ${TomCrypt_ROOT_DIR}/libs ${TomCrypt_ROOT_DIR}/out/
HINTS ${TomCrypt_ROOT_DIR} ${TomCrypt_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TomCrypt DEFAULT_MSG
TomCrypt_INCLUDE_DIR
)

View File

@ -18,29 +18,24 @@
# TomMath_LIBRARIES_STATIC The TomMath libraries.
# TomMath_LIBRARIES_SHARED The TomMath libraries.
find_path(TomMath_ROOT_DIR
NAMES include/tommath.h CMakeLists.txt LICENSE
HINTS ${TomMath_ROOT_DIR}
)
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(TomMath_INCLUDE_DIR
NAMES tommath.h tommath_private.h
HINTS ${TomMath_ROOT_DIR}/include
HINTS ${TomMath_ROOT_DIR}/ ${TomMath_ROOT_DIR}/include/
)
find_library(TomMath_LIBRARIES_STATIC
NAMES tommath.lib tommath.a
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${TomMath_ROOT_DIR} ${TomMath_ROOT_DIR}/build ${TomMath_ROOT_DIR}/libs ${TomMath_ROOT_DIR}/out/
HINTS ${TomMath_ROOT_DIR} ${TomMath_ROOT_DIR}/lib
)
find_library(TomMath_LIBRARIES_SHARED
NAMES tommath.dll tommath.so
PATH_SUFFIXES out/win32_amd64/Release out/win32/Release out/win32_x64/Release
HINTS ${TomMath_ROOT_DIR} ${TomMath_ROOT_DIR}/build ${TomMath_ROOT_DIR}/libs ${TomMath_ROOT_DIR}/out/
HINTS ${TomMath_ROOT_DIR} ${TomMath_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TomMath DEFAULT_MSG
TomMath_INCLUDE_DIR
)

View File

@ -18,30 +18,29 @@
# fvad_LIBRARIES_STATIC The fvad libraries.
# fvad_LIBRARIES_SHARED The fvad libraries.
include(tearoot-helper)
include(FindPackageHandleStandardArgs)
find_path(fvad_ROOT_DIR
NAMES include/fvad.h
HINTS ${fvad_ROOT_DIR}
HINTS ${fvad_ROOT_DIR} ${fvad_ROOT_DIR}/${BUILD_OUTPUT}
)
find_path(fvad_INCLUDE_DIR
NAMES fvad.h
HINTS ${fvad_ROOT_DIR}/include/
HINTS ${fvad_ROOT_DIR} ${fvad_ROOT_DIR}/include/
)
find_library(fvad_LIBRARIES_STATIC
NAMES libfvad.a libfvad.lib
PATH_SUFFIXES lib/
HINTS
${fvad_ROOT_DIR}/lib
HINTS ${fvad_ROOT_DIR} ${fvad_ROOT_DIR}/lib
)
find_library(fvad_LIBRARIES_SHARED
NAMES libfvad.dll libfvad.so
PATH_SUFFIXES lib bin
HINTS ${fvad_ROOT_DIR} ${fvad_ROOT_DIR}/build ${fvad_ROOT_DIR}/libs ${fvad_ROOT_DIR}/out/
HINTS ${fvad_ROOT_DIR} ${fvad_ROOT_DIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(fvad DEFAULT_MSG
fvad_INCLUDE_DIR
)

View File

@ -1,3 +1,6 @@
set(BUILD_OS_TYPE "win32")
set(BUILD_OS_ARCH "amd64")
SET(TomMath_ROOT_DIR "C:/Users/WolverinDEV/TeaSpeak/third_party/tommath")
SET(TomCrypt_ROOT_DIR "C:/Users/WolverinDEV/TeaSpeak/third_party/tomcrypt")
SET(DataPipes_ROOT_DIR "C:/Users/WolverinDEV/TeaSpeak/third_party/DataPipes")

View File

@ -0,0 +1,23 @@
set(BUILD_OS_TYPE "linux")
set(BUILD_OS_ARCH "amd64")
if(NOT LIBRARY_PATH OR LIBRARY_PATH STREQUAL "")
message(FATAL_ERROR "Missing library path")
endif()
include(tearoot-helper)
SET(TomMath_ROOT_DIR "${LIBRARY_PATH}/tommath/${BUILD_OUTPUT}")
SET(TomCrypt_ROOT_DIR "${LIBRARY_PATH}/tomcrypt/${BUILD_OUTPUT}")
SET(DataPipes_ROOT_DIR "${LIBRARY_PATH}/DataPipes/${BUILD_OUTPUT}")
SET(StringVariable_ROOT_DIR "${LIBRARY_PATH}/StringVariable/${BUILD_OUTPUT}")
SET(ThreadPool_ROOT_DIR "${LIBRARY_PATH}/Thread-Pool/${BUILD_OUTPUT}")
SET(ed25519_ROOT_DIR "${LIBRARY_PATH}/ed25519/${BUILD_OUTPUT}")
SET(LibEvent_ROOT_DIR "${LIBRARY_PATH}/libevent/${BUILD_OUTPUT}")
SET(soxr_ROOT_DIR "${LIBRARY_PATH}/soxr/${BUILD_OUTPUT}")
SET(PortAudio_ROOT_DIR "${LIBRARY_PATH}/portaudio/${BUILD_OUTPUT}")
SET(fvad_ROOT_DIR "${LIBRARY_PATH}/libfvad/${BUILD_OUTPUT}")
SET(opus_ROOT_DIR "${LIBRARY_PATH}/opus/${BUILD_OUTPUT}")
SET(breakpad_ROOT_DIR "${LIBRARY_PATH}/breakpad/${BUILD_OUTPUT}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${LIBRARY_PATH}/spdlog/${BUILD_OUTPUT}")
#SET(TeaSpeak_SharedLib_ROOT_DIR "C:/Users/WolverinDEV/TeaSpeak/TeaSpeak-SharedLib")

View File

@ -0,0 +1,34 @@
macro(initialize_build_paths)
if(NOT BUILD_OS_TYPE OR BUILD_OS_TYPE STREQUAL "")
message(FATAL_ERROR "Missing os build type (BUILD_OS_TYPE). Please define it!")
endif()
if(NOT BUILD_OS_ARCH OR BUILD_OS_ARCH STREQUAL "")
message(FATAL_ERROR "Missing os build arch (BUILD_OS_ARCH). Please define it!")
endif()
# Test for valid values
if(BUILD_OS_TYPE STREQUAL "win32")
if(BUILD_OS_ARCH STREQUAL "x86")
message(FATAL_ERROR "We currently not support windows x86")
elseif(BUILD_OS_ARCH STREQUAL "amd64")
else()
message(FATAL_ERROR "Invalid os build arch (${BUILD_OS_ARCH}). Supported OS archs are: amd64, x86")
endif()
elseif(BUILD_OS_TYPE STREQUAL "linux")
if(BUILD_OS_ARCH STREQUAL "x86")
elseif(BUILD_OS_ARCH STREQUAL "amd64")
else()
message(FATAL_ERROR "Invalid os build arch (${BUILD_OS_ARCH}). Supported OS archs are: amd64, x86")
endif()
else()
message(FATAL_ERROR "Invalid os build type (${BUILD_OS_TYPE}). Supported OS types are: linux, win32")
endif()
if(NOT BUILD_OUTPUT OR BUILD_OUTPUT STREQUAL "")
set(BUILD_OUTPUT "/out/${BUILD_OS_TYPE}_${BUILD_OS_ARCH}")
endif()
endmacro()
initialize_build_paths()

View File

@ -7,4 +7,13 @@ git submodule foreach git reset --hard
build_event.sh updated!
build_event.sh updated!
build_os_type: [linux|win32]
build_os_type linux
-> build_os_arch: [x86|amd64]
build_os_type win32
-> build_os_arch: [x86|amd64]

View File

@ -119,8 +119,8 @@ function cmake_build() {
return 1
fi
base_path=$(realpath $1)
build_path="$base_path/out/${build_os_type}_${build_os_arch}/"
local base_path=$(realpath $1)
local build_path="$base_path/out/${build_os_type}_${build_os_arch}/"
if [[ ! -d ${base_path} ]]; then
echo "Missing target directory. CMake build failed"
return 1
@ -143,8 +143,8 @@ function cmake_build() {
return 1
}
parameters=(${@:2})
final_parms=()
local parameters=(${@:2})
local final_parms=()
declare -A final_definitions
#Merge env variables with definitions
@ -175,7 +175,7 @@ function cmake_build() {
[[ ! -z "${C_FLAGS}" ]] && final_definitions["CMAKE_C_FLAGS"]="${final_definitions['CMAKE_C_FLAGS']} ${C_FLAGS}"
[[ ! -z "${CXX_FLAGS}" ]] && final_definitions["CMAKE_CXX_FLAGS"]="${final_definitions['CMAKE_CXX_FLAGS']} ${CXX_FLAGS}"
definition_string=""
local definition_string=""
for i in "${!final_definitions[@]}"
do
definition_string="${definition_string} -D$i=\"${final_definitions[$i]}\""
@ -183,9 +183,9 @@ function cmake_build() {
#Cut of the start space
[[ ! -z ${definition_string} ]] && definition_string=${definition_string:1}
cmake_command="cmake $base_path$base_path_suffix ${final_parms[*]} ${definition_string} ${CMAKE_OPTIONS}"
local cmake_command="cmake $base_path$base_path_suffix ${final_parms[*]} ${definition_string} ${CMAKE_OPTIONS}"
origin_directory=$(pwd)
local origin_directory=$(pwd)
cd ${build_path}
[[ $? -ne 0 ]] && {
echo "Failed to enter build directory!"
@ -203,7 +203,7 @@ function cmake_build() {
return 1
fi
make_command="make ${CMAKE_MAKE_OPTIONS}"
local make_command="make ${CMAKE_MAKE_OPTIONS}"
echo "Executing make command:"
echo "> $make_command"
eval "${make_command}"
@ -212,7 +212,7 @@ function cmake_build() {
return 1
fi
make_install_command="make install"
local make_install_command="make install"
echo "Executing make install command:"
echo "> $make_install_command"
eval "${make_install_command}"
@ -232,4 +232,45 @@ function check_err_exit() {
[[ ${#@} -gt 1 ]] && echo "${@:2}"
echo -e "Aborting build\e[0;39m"
exit 1
}
function pline() {
local width="150"
local padding="$(printf '%0.1s' ={1..120})"
printf "%*.*s $color_green%s$color_normal %*.*s\n" 0 "$(( ($width - 2 - ${#1}) / 2))" "$padding" "$1" 0 "$(( ($width - 1 - ${#1}) / 2 ))" "$padding"
}
function format_time() {
local time_needed_s=$(($1/1000000000))
local time_needed_m=$(($time_needed_s/60))
local time_needed_s=$(($time_needed_s - $time_needed_m * 60))
time=""
if [[ ${time_needed_m} != "0" ]]; then
[[ -z ${time} ]] && time="$time_needed_m min" || time="${time} $time_needed_m min"
fi
if [[ ${time_needed_s} != "0" ]]; then
[[ -z ${time} ]] && time="$time_needed_s sec" || time="${time} $time_needed_s sec"
fi
[[ -z ${time} ]] && time="0 sec"
}
declare -A task_timings
function begin_task() {
local name="$1"
local display_name="$2"
task_timings[$name]="$(date +%s%N)"
pline "$display_name"
}
function end_task() {
local name="$1"
local display_name="$2"
time_end=$(date +%s%N)
time_start=${task_timings[$name]}
format_time $(($time_end-$time_start))
pline "$display_name ($time)"
}

1
shared Submodule

@ -0,0 +1 @@
Subproject commit 89fd73591929d08cf27e8f576e91f7f0f65b1cb3

@ -1 +1 @@
Subproject commit d6f9c359d219055a89c676cb8886421b145a08da
Subproject commit c19dfe278c0fb8956cbfa36ab3ea8e2d0c3a14dd

38
third_party/build.sh vendored
View File

@ -3,36 +3,13 @@
# Enter third_party/ directory
cd $(dirname $0)
color_green='\e[92m'
color_normal='\e[39m'
function pline() {
width="120"
padding="$(printf '%0.1s' ={1..120})"
printf "%*.*s $color_green%s$color_normal %*.*s\n" 0 "$(( ($width - 2 - ${#1}) / 2))" "$padding" "$1" 0 "$(( ($width - 1 - ${#1}) / 2 ))" "$padding"
}
function format_time() {
time_needed_s=$(($1/1000000000))
time_needed_m=$(($time_needed_s/60))
time_needed_s=$(($time_needed_s - $time_needed_m * 60))
time=""
if [[ ${time_needed_m} != "0" ]]; then
[[ -z ${time} ]] && time="$time_needed_m min" || time="${time} $time_needed_m min"
fi
if [[ ${time_needed_s} != "0" ]]; then
[[ -z ${time} ]] && time="$time_needed_s sec" || time="${time} $time_needed_s sec"
fi
[[ -z ${time} ]] && time="0 sec"
}
source ../scripts/build_helper.sh
begin_task "build_third_party" "Building libraries"
function exec_script() {
name=$(echo "$1" | sed -n -E 's:^build_(.*)\.sh:\1:p')
time_begin=$(date +%s%N)
begin_task "build_$name" "Building $name"
pline "$name"
echo -e "Building library with script $color_green${1}$color_normal"
./${1}
if [[ $? -ne 0 ]]; then
@ -41,13 +18,10 @@ function exec_script() {
fi
#Log the result
time_end=$(date +%s%N)
format_time $(($time_end - $time_begin))
pline "$name ($time)"
end_task "build_$name" "Finished $name"
echo ""
}
global_time_begin=$(date +%s%N)
exec_script build_boringssl.sh
exec_script build_breakpad.sh #Not required for windows TeaClient
exec_script build_event.sh
@ -66,6 +40,4 @@ exec_script build_yaml.sh
exec_script build_jemalloc.sh #Not required for TeaClient
#Log the result
global_time_end=$(date +%s%N)
format_time $(($global_time_end - $global_time_begin))
pline "Build all libraries successfully ($time)!"
end_task "build_third_party" "Build all libraries successfully"