From 2a8a726222ad93bf6524a7891b7a4e972b334230 Mon Sep 17 00:00:00 2001 From: Piotr Gaczkowski Date: Mon, 17 Jun 2024 09:42:08 +0200 Subject: [PATCH] Make alext.h optional --- CMakeLists.txt | 2 ++ src/modules/audio/openal/Audio.h | 2 ++ src/modules/audio/openal/Effect.h | 2 ++ src/modules/audio/openal/Filter.h | 2 ++ src/modules/audio/openal/Pool.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1d8ddcd1..faa3ed17b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,6 +198,8 @@ Please see https://github.com/love2d/megasource find_package(OpenAL REQUIRED) target_include_directories(lovedep::OpenAL INTERFACE ${OPENAL_INCLUDE_DIR}) target_link_libraries(lovedep::OpenAL INTERFACE ${OPENAL_LIBRARY}) + include(CheckIncludeFileCXX) + check_include_file_cxx("alext.h" HAVE_OPENAL_ALEXT_H) find_package(ModPlug REQUIRED) target_include_directories(lovedep::Modplug INTERFACE ${MODPLUG_INCLUDE_DIR}) diff --git a/src/modules/audio/openal/Audio.h b/src/modules/audio/openal/Audio.h index 5dce39609..501cb1321 100644 --- a/src/modules/audio/openal/Audio.h +++ b/src/modules/audio/openal/Audio.h @@ -52,8 +52,10 @@ #else #include #include +#if defined(HAVE_OPENAL_ALEXT_H) #include #endif +#endif namespace love { diff --git a/src/modules/audio/openal/Effect.h b/src/modules/audio/openal/Effect.h index bff3ddfa0..793edb4ea 100644 --- a/src/modules/audio/openal/Effect.h +++ b/src/modules/audio/openal/Effect.h @@ -36,8 +36,10 @@ #else #include #include +#if defined(HAVE_OPENAL_ALEXT_H) #include #endif +#endif #include #include diff --git a/src/modules/audio/openal/Filter.h b/src/modules/audio/openal/Filter.h index c8a4bf46f..654c6205c 100644 --- a/src/modules/audio/openal/Filter.h +++ b/src/modules/audio/openal/Filter.h @@ -36,8 +36,10 @@ #else #include #include +#if defined(HAVE_OPENAL_ALEXT_H) #include #endif +#endif #include diff --git a/src/modules/audio/openal/Pool.h b/src/modules/audio/openal/Pool.h index f44d7f460..79dc6436e 100644 --- a/src/modules/audio/openal/Pool.h +++ b/src/modules/audio/openal/Pool.h @@ -48,8 +48,10 @@ #else #include #include +#if defined(HAVE_OPENAL_ALEXT_H) #include #endif +#endif namespace love {