From 05610d84f6fca2ffc25e6a2600448f624a276c5f Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 5 Mar 2017 11:47:32 -0800 Subject: [PATCH] fix linking OpenAL statically on Win32/MXE Add the necessary AL_LIBTYPE_STATIC define for MXE and non-msys2 win32 builds so that OpenAL can be linked statically without errors. --- src/wx/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index b502fd0c..d1f57b5c 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -45,6 +45,10 @@ endif(NOT ENABLE_DIRECT3D) if(ENABLE_OPENAL) FIND_PACKAGE(OpenAL REQUIRED) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) + + IF(WIN32 AND ((NOT (MINGW AND MSYS)) OR CMAKE_TOOLCHAIN_FILE MATCHES mxe)) + ADD_DEFINITIONS(-DAL_LIBTYPE_STATIC) + ENDIF() else(ENABLE_OPENAL) ADD_DEFINITIONS (-DNO_OAL) endif(ENABLE_OPENAL)