summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authornega <1098-nega@users.noreply.gitlab.kitware.com>2023-03-28 22:48:59 (GMT)
committerBrad King <brad.king@kitware.com>2023-03-29 17:42:02 (GMT)
commit1d06554fc6e00fdf8a6f15db9f56ec965cabeef9 (patch)
tree52c949db82c5cd621305055afe22ed726c7ac2bc /Tests
parent5f5476ee315ffdaedc37115d2d7049f4f3f2f05d (diff)
downloadCMake-1d06554fc6e00fdf8a6f15db9f56ec965cabeef9.zip
CMake-1d06554fc6e00fdf8a6f15db9f56ec965cabeef9.tar.gz
CMake-1d06554fc6e00fdf8a6f15db9f56ec965cabeef9.tar.bz2
Tests: Fix FindOpenAL test for macOS framework
- Use framework-style includes. - Hush deprecation warnings when compiling test.
Diffstat (limited to 'Tests')
-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 fa3e263..6479df6 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 bb45faf..1396c60 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()