1
0
Fork 0

Remove custom FindOpenAL.cmake

Adjust IAXClient OpenAL backend so we can use the standard CMake
finder for OpenAL (or OpenAL-soft).
This commit is contained in:
James Turner 2021-12-25 13:38:47 +00:00
parent 5b537a176e
commit eb82084c53
2 changed files with 4 additions and 56 deletions

View file

@ -1,15 +1,11 @@
#include "iaxclient_lib.h"
#if defined(__APPLE__) && !defined(SG_SOUND_USES_OPENALSOFT)
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#elif defined(OPENALSDK)
// changed by James Turner to use non-prefixed OpenAL include paths,
// which is what CMake official FindOpenAL.cmake and the OpenAL-soft Config.cmake
// expect to provide. This avoids any pre-processor logic to decide which
// prefix is correct.
#include <al.h>
#include <alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#endif
struct openal_priv_data
{

View file

@ -1,48 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindOpenAL
----------
Finds Open Audio Library (OpenAL).
This module defines ``OPENAL_LIBRARY OPENAL_FOUND``, if
false, do not try to link to OpenAL ``OPENAL_INCLUDE_DIR``, where to find
the headers.
``$OPENALDIR`` is an environment variable that would correspond to the
``./configure --prefix=$OPENALDIR`` used in building OpenAL.
Created by Eric Wing. This was influenced by the ``FindSDL.cmake``
module.
#]=======================================================================]
# Modifed for FlightGear by James Turner
# We want to use the 'parented' directories here, unlike the standard CMake version
# of this.
if (OPENAL_LIBRARY AND OPENAL_INCLUDE_DIR)
# already set, do nothing
else()
find_path(OPENAL_INCLUDE_DIR OpenAL/al.h AL/al.h
HINTS
ENV OPENALDIR
PATH_SUFFIXES include
PATHS
/opt
)
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
ENV OPENALDIR
PATH_SUFFIXES libx32 lib64 lib libs64 libs
PATHS
/opt
)
find_package_handle_standard_args(OpenAL DEFAULT_MSG OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
endif()