summaryrefslogtreecommitdiff
path: root/Tests/FindOpenAL/Test
diff options
context:
space:
mode:
authornega <1098-nega@users.noreply.gitlab.kitware.com>2023-03-28 18:48:59 -0400
committerBrad King <brad.king@kitware.com>2023-03-29 13:42:02 -0400
commit1d06554fc6e00fdf8a6f15db9f56ec965cabeef9 (patch)
tree52c949db82c5cd621305055afe22ed726c7ac2bc /Tests/FindOpenAL/Test
parent5f5476ee315ffdaedc37115d2d7049f4f3f2f05d (diff)
downloadcmake-1d06554fc6e00fdf8a6f15db9f56ec965cabeef9.tar.gz
Tests: Fix FindOpenAL test for macOS framework
- Use framework-style includes. - Hush deprecation warnings when compiling test.
Diffstat (limited to 'Tests/FindOpenAL/Test')
-rw-r--r--Tests/FindOpenAL/Test/CMakeLists.txt6
-rw-r--r--Tests/FindOpenAL/Test/main.cxx9
2 files changed, 13 insertions, 2 deletions
diff --git a/Tests/FindOpenAL/Test/CMakeLists.txt b/Tests/FindOpenAL/Test/CMakeLists.txt
index fa3e2638ee..6479df6420 100644
--- a/Tests/FindOpenAL/Test/CMakeLists.txt
+++ b/Tests/FindOpenAL/Test/CMakeLists.txt
@@ -12,3 +12,9 @@ add_executable(test_var main.cxx)
target_include_directories(test_var PRIVATE ${OPENAL_INCLUDE_DIR})
target_link_libraries(test_var PRIVATE ${OPENAL_LIBRARY})
add_test(NAME test_var COMMAND test_var)
+
+# OpenAL has been deprecated on macOS since Catalina (10.15)
+if(APPLE)
+ target_compile_options(test_tgt PRIVATE "-Wno-deprecated-declarations")
+ target_compile_options(test_var PRIVATE "-Wno-deprecated-declarations")
+endif()
diff --git a/Tests/FindOpenAL/Test/main.cxx b/Tests/FindOpenAL/Test/main.cxx
index bb45faf5b9..1396c60b32 100644
--- a/Tests/FindOpenAL/Test/main.cxx
+++ b/Tests/FindOpenAL/Test/main.cxx
@@ -1,5 +1,10 @@
-#include <AL/al.h>
-#include <AL/alc.h>
+#ifdef __APPLE__
+# include "OpenAL/al.h"
+# include "OpenAL/alc.h"
+#else
+# include <AL/al.h>
+# include <AL/alc.h>
+#endif
#include <stdio.h>
int main()