Codechange: replace "magic" trick with simpler straight forward code
[openttd-github.git] / cmake / FindXaudio2.cmake
blob477dfea728b04f19130b58e30a015ae7449cebcf
1 # Autodetect if xaudio2 can be used.
3 include(CheckCXXSourceCompiles)
4 set(CMAKE_REQUIRED_FLAGS "")
6 check_cxx_source_compiles("
7     #include <cstdio>
8     #include <windows.h>
10     #undef NTDDI_VERSION
11     #undef _WIN32_WINNT
13     #define NTDDI_VERSION    NTDDI_WIN8
14     #define _WIN32_WINNT     _WIN32_WINNT_WIN8
16     #include <xaudio2.h>
17     int main() { printf(\"%s\\\\n\", XAUDIO2_DLL_A); return 0; }"
18     XAUDIO2_FOUND