1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(build): add install steps for libfilteraudio on OSX

This commit is contained in:
sudden6 2017-05-15 22:42:15 +02:00
parent 526701fa9f
commit 8f2401fee6
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
5 changed files with 29 additions and 16 deletions

View File

@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 2.8.11)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
option(USE_FILTERAUDIO "Enable the echo canceling backend" ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
@ -16,6 +17,12 @@ endif()
set(ENV{PKG_CONFIG_PATH}
${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
# necessary to find openal-soft on mac os
if(APPLE)
set(ENV{PKG_CONFIG_PATH}
/usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
endif()
execute_process(
COMMAND brew --prefix qt5
OUTPUT_VARIABLE QT_PREFIX_PATH
@ -185,8 +192,6 @@ set(${PROJECT_NAME}_SOURCES
src/audio/audio.h
src/audio/backend/openal.cpp
src/audio/backend/openal.h
src/audio/backend/openal2.cpp
src/audio/backend/openal2.h
src/chatlog/chatlinecontent.cpp
src/chatlog/chatlinecontent.h
src/chatlog/chatlinecontentproxy.cpp
@ -520,6 +525,19 @@ if(${ENABLE_GTK_SYSTRAY})
endif()
endif()
if(${USE_FILTERAUDIO})
search_dependency(FILTERAUDIO LIBRARY filteraudio OPTIONAL)
if(${FILTERAUDIO_FOUND})
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/audio/backend/openal2.cpp
src/audio/backend/openal2.h)
add_definitions(-DUSE_FILTERAUDIO=1)
message(STATUS "using filteraudio")
else()
message(STATUS "not using filteraudio, libfilteraudio not found")
endif()
endif()
# the compiler flags for compiling C sources
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )

View File

@ -116,7 +116,7 @@ if (NOT TOXCORE_FOUND OR
search_dependency(TOXAV PACKAGE libtoxav)
endif()
search_dependency(OPENAL PACKAGE openal FRAMEWORK OpenAL)
search_dependency(OPENAL PACKAGE openal)
search_dependency(FILTERAUDIO LIBRARY filteraudio)
if (PLATFORM_EXTENSIONS AND UNIX AND NOT APPLE)

View File

@ -41,6 +41,7 @@ QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location
FILTERAUIO_DIR="${MAIN_DIR}/filter_audio" # Change to Git location
LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
@ -166,7 +167,13 @@ install() {
else
brew install cmake
fi
brew install ffmpeg qrencode qt5 sqlcipher
brew install ffmpeg qrencode qt5 sqlcipher openal-soft
fcho "Cloning filter_audio ... "
git clone --branch v0.0.1 --depth=1 https://github.com/irungentoo/filter_audio "$FILTERAUIO_DIR"
cd "$FILTERAUIO_DIR"
fcho "Installing filter_audio ... "
make install PREFIX="$LIB_INSTALL_PREFIX"
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"

View File

@ -32,14 +32,8 @@
#include <cassert>
#if defined(__APPLE__) && defined(__MACH__)
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
#ifndef ALC_ALL_DEVICES_SPECIFIER
// compatibility with older versions of OpenAL

View File

@ -32,15 +32,9 @@
#include <cassert>
#if defined(__APPLE__) && defined(__MACH__)
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#include <OpenAL/alext.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#include <AL/alext.h>
#endif
extern "C" {
#include <filter_audio.h>