Tests: Fix FindOpenAL test for macOS framework

- Use framework-style includes.
- Hush deprecation warnings when compiling test.
This commit is contained in:
nega 2023-03-28 18:48:59 -04:00 committed by Brad King
parent 5f5476ee31
commit 1d06554fc6
2 changed files with 13 additions and 2 deletions

View File

@ -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()

View File

@ -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()