Fixed some windows builds

This commit is contained in:
WolverinDEV 2020-02-08 20:45:04 +01:00
parent 411778f932
commit 1f58621b3b
9 changed files with 703 additions and 582 deletions

View File

@ -3,7 +3,7 @@
cd "$(dirname $0)/../"
project_name="__build_teaclient"
source ../scripts/build_helper.sh
source ../build-helpers/build_helper.sh
function install_npm() {
begin_task "${project_name}_update" "Installing NPM"
@ -44,6 +44,7 @@ function compile_scripts() {
function compile_native() {
begin_task "${project_name}_native" "Compiling native extensions"
local build_path="native/out/${build_os_type}_${build_os_arch}/"
[[ -d ${build_path} ]] && rm -r ${build_path}
mkdir -p ${build_path}
@ -57,10 +58,11 @@ function compile_native() {
[[ ! -z "$tearoot_cmake_config" ]] && _arguments="${_arguments} -DCMAKE_PLATFORM_INCLUDE=\"$tearoot_cmake_config\""
[[ ! -z "$traroot_library" ]] && _arguments="${_arguments} -DLIBRARY_PATH=\"$traroot_library\""
local _generator=""
[[ ${build_os_type} == "win32" ]] && _generator='-G"Visual Studio 16 2019"'
local _cmake_generator=""
[[ -n "${build_cmake_generator}" ]] && _cmake_generator="${build_cmake_generator}"
[[ -z "${_cmake_generator}" && "${build_os_type}" == "win32" ]] && _cmake_generator=" -G\"Visual Studio 15 2017 Win64\""
_command="cmake ../../ ${_generator} -DCMAKE_BUILD_TYPE=RelWithDebInfo ${_arguments}"
_command="cmake ../../ ${_cmake_generator} -DCMAKE_BUILD_TYPE=RelWithDebInfo ${_arguments}"
echo "Executing cmake command $_command"
eval ${_command}

View File

@ -65,6 +65,9 @@ add_nodejs_module(${MODULE_NAME} ${SOURCE_FILES} ${NODEJS_SOURCE_FILES})
target_link_libraries(${MODULE_NAME} ${NODEJS_LIBRARIES})
#target_compile_options(${MODULE_NAME} PUBLIC "-fPIC")
find_package(soundio REQUIRED)
include_directories(${soundio_INCLUDE_DIR})
find_package(TomMath REQUIRED)
include_directories(${TomMath_INCLUDE_DIR})
@ -76,8 +79,6 @@ include_directories(${DataPipes_INCLUDE_DIR})
find_package(Libevent REQUIRED)
include_directories(${LIBEVENT_INCLUDE_DIRS})
message("libevent include dir: ${LIBEVENT_INCLUDE_DIRS}")
message("libevent static libraries: ${LIBEVENT_STATIC_LIBRARIES}")
find_package(TeaSpeak_SharedLib REQUIRED)
include_directories(${TeaSpeak_SharedLib_INCLUDE_DIR})
@ -88,8 +89,6 @@ include_directories(${StringVariable_INCLUDE_DIR})
find_package(Ed25519 REQUIRED)
include_directories(${ed25519_INCLUDE_DIR})
find_package(soundio REQUIRED)
find_package(ThreadPool REQUIRED)
include_directories(${ThreadPool_INCLUDE_DIR})
if (WIN32)
@ -126,7 +125,8 @@ set(REQUIRED_LIBRARIES
${opus_LIBRARIES_STATIC}
${ed25519_LIBRARIES_STATIC}
soundio::static
#soundio::static
${soundio_LIBRARIES_STATIC}
spdlog::spdlog_header_only
Nan::Helpers
@ -148,10 +148,10 @@ target_link_libraries(${MODULE_NAME} ${REQUIRED_LIBRARIES})
target_compile_definitions(${MODULE_NAME} PUBLIC -DNODEJS_API)
add_executable(Audio-Test ${SOURCE_FILES} test/audio/main.cpp)
target_link_libraries(Audio-Test ${REQUIRED_LIBRARIES} soundio.a)
target_link_libraries(Audio-Test ${REQUIRED_LIBRARIES})
add_executable(Audio-Test-2 ${SOURCE_FILES} test/audio/sio.cpp)
target_link_libraries(Audio-Test-2 ${REQUIRED_LIBRARIES} soundio.a)
target_link_libraries(Audio-Test-2 ${REQUIRED_LIBRARIES})
add_executable(HW-UID-Test src/hwuid.cpp)
target_link_libraries(HW-UID-Test

View File

@ -264,7 +264,7 @@ void AudioInput::delete_consumer(const std::shared_ptr<AudioConsumer> &source) {
source->handle = nullptr;
}
void AudioInput::consume(const void *input, unsigned long frameCount, size_t /* channels */) {
void AudioInput::consume(const void *input, size_t frameCount, size_t /* channels */) {
if(this->_volume != 1 && false) {
auto ptr = (float*) input;
auto left = frameCount * this->_channel_count;

View File

@ -64,7 +64,7 @@ namespace tc {
inline float volume() { return this->_volume; }
inline void set_volume(float value) { this->_volume = value; }
private:
void consume(const void *, unsigned long, size_t) override;
void consume(const void *, size_t, size_t) override;
size_t const _channel_count;
size_t const _sample_rate;

View File

@ -169,7 +169,7 @@ void AudioOutput::cleanup_buffers() {
this->source_buffer_length = 0;
}
void AudioOutput::fill_buffer(void *output, unsigned long frameCount, size_t channels) {
void AudioOutput::fill_buffer(void *output, size_t frameCount, size_t channels) {
lock_guard buffer_lock(this->buffer_lock);
if(this->_volume <= 0) {
for(auto& source : this->_sources)

View File

@ -90,7 +90,7 @@ namespace tc::audio {
inline float volume() { return this->_volume; }
inline void set_volume(float value) { this->_volume = value; }
private:
void fill_buffer(void *, size_t frames, size_t channels) override ;
void fill_buffer(void *, size_t frames, size_t channels) override;
size_t const _channel_count;
size_t const _sample_rate;

View File

@ -2,13 +2,14 @@
#include <soundio/soundio.h>
#include <memory>
#include <array>
#include <vector>
#include <mutex>
#include "./AudioDriver.h"
namespace tc::audio {
struct BackendPriority {
static constexpr std::array<int, SoundIoBackendDummy + 1> mapping{
static constexpr std::array<int, (int) SoundIoBackendDummy + 1> mapping{
/* SoundIoBackendNone */ -100,
/* SoundIoBackendJack */ 100,
/* SoundIoBackendPulseAudio */ 90,

1248
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -38,7 +38,7 @@
"asar": "^2.0.1",
"cmake-js": "^4.0.1",
"ejs": "^2.7.1",
"electron-installer-debian": "^0.8.1",
"electron-installer-windows": "^1.1.1",
"electron-packager": "8.7.2",
"electron-winstaller": "^2.7.0",
"electron-wix-msi": "^2.2.0",