# CMake build file list for OpenAL
cmake_minimum_required(VERSION 3.13)
enable_testing()
if(APPLE)
# The workaround for try_compile failing with code signing
# since cmake-3.18.2, not required
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
${CMAKE_TRY_COMPILE_PLATFORM_VARIABLES}
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED"
"CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED NO)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
# Fix compile failure with armv7 deployment target >= 11.0, xcode clang
# will report:
# error: invalid iOS deployment version '--target=armv7-apple-ios13.6',
# iOS 10 is the maximum deployment target for 32-bit targets
# If CMAKE_OSX_DEPLOYMENT_TARGET is not defined, cmake will choose latest
# deployment target
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ".*armv7.*")
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET
OR NOT CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "11.0")
message(STATUS "Forcing iOS deployment target to 10.0 for armv7")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.0" CACHE STRING "Minimum OS X deployment version"
FORCE)
endif()
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(ALSOFT_UWP TRUE)
endif()
if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0005 NEW)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
if(POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif(POLICY CMP0042)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif(POLICY CMP0054)
if(POLICY CMP0058)
cmake_policy(SET CMP0058 NEW)
endif(POLICY CMP0058)
if(POLICY CMP0063)
cmake_policy(SET CMP0063 NEW)
endif(POLICY CMP0063)
if(POLICY CMP0075)
cmake_policy(SET CMP0075 NEW)
endif(POLICY CMP0075)
if(POLICY CMP0092)
cmake_policy(SET CMP0092 NEW)
endif(POLICY CMP0092)
if(POLICY CMP0117)
cmake_policy(SET CMP0117 NEW)
endif(POLICY CMP0117)
endif(COMMAND CMAKE_POLICY)
project(OpenAL)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
if(NOT CMAKE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX "" CACHE STRING
"Library postfix for debug builds. Normally left blank."
FORCE)
endif()
set(DEFAULT_TARGET_PROPS
# Require C++17.
CXX_STANDARD 17
CXX_STANDARD_REQUIRED TRUE
# Prefer C11, but support C99 and earlier when possible.
C_STANDARD 11)
set(CMAKE_MODULE_PATH "${OpenAL_SOURCE_DIR}/cmake")
include(CheckFunctionExists)
include(CheckLibraryExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckStructHasMember)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
find_package(PkgConfig)
find_package(SDL2 QUIET)
option(ALSOFT_DLOPEN "Check for the dlopen API for loading optional libs" ON)
option(ALSOFT_WERROR "Treat compile warnings as errors" OFF)
option(ALSOFT_UTILS "Build utility programs" ON)
option(ALSOFT_NO_CONFIG_UTIL "Disable building the alsoft-config utility" OFF)
option(ALSOFT_EXAMPLES "Build example programs" ON)
option(ALSOFT_TESTS "Build test programs" OFF)
option(ALSOFT_INSTALL "Install main library" ON)
option(ALSOFT_INSTALL_CONFIG "Install alsoft.conf sample configuration file" ON)
option(ALSOFT_INSTALL_HRTF_DATA "Install HRTF data files" ON)
option(ALSOFT_INSTALL_AMBDEC_PRESETS "Install AmbDec preset files" ON)
option(ALSOFT_INSTALL_EXAMPLES "Install example programs (alplay, alstream, ...)" ON)
option(ALSOFT_INSTALL_UTILS "Install utility programs (openal-info, alsoft-config, ...)" ON)
option(ALSOFT_UPDATE_BUILD_VERSION "Update git build version info" ON)
option(ALSOFT_EAX "Enable legacy EAX extensions" ${WIN32})
option(ALSOFT_SEARCH_INSTALL_DATADIR "Search the installation data directory" OFF)
if(ALSOFT_SEARCH_INSTALL_DATADIR)
set(ALSOFT_INSTALL_DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
endif()
if(DEFINED SHARE_INSTALL_DIR)
message(WARNING "SHARE_INSTALL_DIR is deprecated. Use the variables provided by the GNUInstallDirs module instead")
set(CMAKE_INSTALL_DATADIR "${SHARE_INSTALL_DIR}")
endif()
if(DEFINED LIB_SUFFIX)
message(WARNING "LIB_SUFFIX is deprecated. Use the variables provided by the GNUInstallDirs module instead")
endif()
if(DEFINED ALSOFT_CONFIG)
message(WARNING "ALSOFT_CONFIG is deprecated. Use ALSOFT_INSTALL_CONFIG instead")
endif()
if(DEFINED ALSOFT_HRTF_DEFS)
message(WARNING "ALSOFT_HRTF_DEFS is deprecated. Use ALSOFT_INSTALL_HRTF_DATA instead")
endif()
if(DEFINED ALSOFT_AMBDEC_PRESETS)
message(WARNING "ALSOFT_AMBDEC_PRESETS is deprecated. Use ALSOFT_INSTALL_AMBDEC_PRESETS instead")
endif()
set(CPP_DEFS ) # C pre-processor, not C++
set(INC_PATHS )
set(C_FLAGS )
set(LINKER_FLAGS )
set(LINKER_FLAGS_DEBUG )
set(LINKER_FLAGS_RELEASE )
set(EXTRA_LIBS )
if(WIN32)
set(CPP_DEFS ${CPP_DEFS} _WIN32 NOMINMAX)
if(MINGW)
set(CPP_DEFS ${CPP_DEFS} __USE_MINGW_ANSI_STDIO)
endif()
option(ALSOFT_BUILD_ROUTER "Build the router (EXPERIMENTAL; creates OpenAL32.dll and soft_oal.dll)" OFF)
if(MINGW)
option(ALSOFT_BUILD_IMPORT_LIB "Build an import .lib using dlltool (requires sed)" ON)
endif()
elseif(APPLE)
option(ALSOFT_OSX_FRAMEWORK "Build as macOS framework" OFF)
endif()
# QNX's gcc do not uses /usr/include and /usr/lib paths by default
if("${CMAKE_C_PLATFORM_ID}" STREQUAL "QNX")
set(INC_PATHS ${INC_PATHS} /usr/include)
set(LINKER_FLAGS ${LINKER_FLAGS} -L/usr/lib)
endif()
# When the library is built for static linking, apps should define
# AL_LIBTYPE_STATIC when including the AL headers.
if(NOT LIBTYPE)
set(LIBTYPE SHARED)
endif()
set(LIB_MAJOR_VERSION "1")
set(LIB_MINOR_VERSION "23")
set(LIB_REVISION "1")
set(LIB_VERSION "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_REVISION}")
set(LIB_VERSION_NUM ${LIB_MAJOR_VERSION},${LIB_MINOR_VERSION},${LIB_REVISION},0)
set(EXPORT_DECL "")
# Some systems erroneously require the __STDC_FORMAT_MACROS macro to be defined
# to get the fixed-width integer type formatter macros.
check_cxx_source_compiles("#include <cinttypes>
#include <cstdio>
int main()
{
int64_t i64{};
std::printf(\"%\" PRId64, i64);
}"
HAVE_STDC_FORMAT_MACROS)
if(NOT HAVE_STDC_FORMAT_MACROS)
set(CPP_DEFS ${CPP_DEFS} __STDC_FORMAT_MACROS)
endif()
if(NOT WIN32)
# Check if _POSIX_C_SOURCE and _XOPEN_SOURCE needs to be set for POSIX functions
check_symbol_exists(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN_DEFAULT)
if(NOT HAVE_POSIX_MEMALIGN_DEFAULT)
set(OLD_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600")
check_symbol_exists(posix_memalign stdlib.h HAVE_POSIX_MEMALIGN_POSIX)
if(NOT HAVE_POSIX_MEMALIGN_POSIX)
set(CMAKE_REQUIRED_FLAGS ${OLD_REQUIRED_FLAGS})
else()
set(CPP_DEFS ${CPP_DEFS} _POSIX_C_SOURCE=200112L _XOPEN_SOURCE=600)
endif()
endif()
unset(OLD_REQUIRED_FLAGS)
endif()
# C99 has restrict, but C++ does not, so we can only utilize __restrict.
check_cxx_source_compiles("int *__restrict foo;
int main() { return 0; }" HAVE___RESTRICT)
if(HAVE___RESTRICT)
set(CPP_DEFS ${CPP_DEFS} RESTRICT=__restrict)
else()
set(CPP_DEFS ${CPP_DEFS} "RESTRICT=")
endif()
# Some systems may need libatomic for atomic functions to work
set(OLD_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
set(CMAKE_REQUIRED_LIBRARIES ${OLD_REQUIRED_LIBRARIES} atomic)
check_cxx_source_compiles("#include <atomic>
std::atomic
lsx202406
- 粉丝: 3046
- 资源: 5780
最新资源
- jetty-test-policy-javadoc-1.2-10.el7.x64-86.rpm.tar.gz
- jetty-toolchain-1.4-9.el7.x64-86.rpm.tar.gz
- jetty-util-9.0.3-8.el7.x64-86.rpm.tar.gz
- 六载整车仿真经验,分享Cruise与Matlab Simulink联合仿真技巧,远程指导与咨询专业服务,仿真模型展示及定制服务,cruise与matlab sumulink联合仿真远程指导与咨询
- jetty-version-maven-plugin-1.0.7-9.el7.x64-86.rpm.tar.gz
- jetty-version-maven-plugin-javadoc-1.0.7-9.el7.x64-86.rpm.tar.gz
- 三菱MCGS PLC四路抢答器智能控制系统详解:梯形图程序、接线图与组态画面全解析,三菱 MCGS 基于PLC的四路抢答器控制系统 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面 ,核心关键
- jetty-webapp-9.0.3-8.el7.x64-86.rpm.tar.gz
- 基于Matlab Simulink的储能系统变换模型与钒液流电池仿真研究:功能实现及效果展示,基于Matlab Simulink实现了以下功能,搭建了储能系统变模型以及钒液流电池模型,仿真效果较好,系
- jetty-websocket-api-9.0.3-8.el7.x64-86.rpm.tar.gz
- 电火花线切割编程软件EDMCAD源代码解析与Visual C++2008绘图功能展示,电火花线切割编程软件EDMCAD软件源码,源程序,源代码 用Visual C++2008编写的,可以绘图,支持d
- jetty-websocket-client-9.0.3-8.el7.x64-86.rpm.tar.gz
- 基于S7-200 PLC与组态王的邮件分拣控制系统详解:梯形图程序、接线图与组态画面全解析,基于S7-200 PLC和组态王的邮件分拣控制系统 带解释的梯形图程序,接线图原理图图纸,io分配,组态画面
- jetty-websocket-common-9.0.3-8.el7.x64-86.rpm.tar.gz
- S7-1200 PLC改造M7120型平面磨床电气控制系统,提升加工效率与精度,S7-1200 MCGS M7120型平面磨床电气控制系统的PLC改造 ,核心关键词:S7-1200 PLC; MCG
- jetty-websocket-parent-9.0.3-8.el7.x64-86.rpm.tar.gz
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈