diff options
Diffstat (limited to 'contrib/DirectX-Headers-1.618.2/test/CMakeLists.txt')
| -rw-r--r-- | contrib/DirectX-Headers-1.618.2/test/CMakeLists.txt | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/contrib/DirectX-Headers-1.618.2/test/CMakeLists.txt b/contrib/DirectX-Headers-1.618.2/test/CMakeLists.txt new file mode 100644 index 0000000..5ad9ace --- /dev/null +++ b/contrib/DirectX-Headers-1.618.2/test/CMakeLists.txt | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | # Copyright (c) Microsoft Corporation. | ||
| 2 | # Licensed under the MIT License. | ||
| 3 | |||
| 4 | list(APPEND dxlibs "") | ||
| 5 | # Check if in WSL and if has DirectX driver and runtime | ||
| 6 | if(EXISTS "/usr/lib/wsl/lib/") | ||
| 7 | find_library(libd3d12 d3d12 HINTS /usr/lib/wsl/lib) | ||
| 8 | find_library(libdxcore dxcore HINTS /usr/lib/wsl/lib) | ||
| 9 | list(APPEND dxlibs ${libd3d12} ${libdxcore}) | ||
| 10 | else() | ||
| 11 | # Fallback to default: let CMake look for libs | ||
| 12 | list(APPEND dxlibs d3d12) | ||
| 13 | if (MSVC) | ||
| 14 | # MINGW doesn't have dxcore yet | ||
| 15 | list(APPEND dxlibs dxcore) | ||
| 16 | endif() | ||
| 17 | endif() | ||
| 18 | |||
| 19 | project(DirectX-Headers-Test | ||
| 20 | DESCRIPTION "DirectX-Header test" | ||
| 21 | HOMEPAGE_URL "https://github.com/microsoft/DirectX-Headers/" | ||
| 22 | LANGUAGES CXX) | ||
| 23 | |||
| 24 | set(CMAKE_CXX_STANDARD 17) | ||
| 25 | set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| 26 | set(CMAKE_CXX_EXTENSIONS OFF) | ||
| 27 | |||
| 28 | option(DXHEADERS_BUILD_COM_ATL "Build using ATL CComPtr" OFF) | ||
| 29 | |||
| 30 | set(TEST_EXES DirectX-Headers-Test DirectX-Headers-Check-Feature-Support-Test) | ||
| 31 | |||
| 32 | add_executable(DirectX-Headers-Test test.cpp) | ||
| 33 | add_test(NAME DirectX-Headers-Test COMMAND DirectX-Headers-Test) | ||
| 34 | add_executable(DirectX-Headers-Check-Feature-Support-Test feature_check_test.cpp) | ||
| 35 | add_test(NAME DirectX-Headers-Check-Feature-Support-Test COMMAND DirectX-Headers-Check-Feature-Support-Test) | ||
| 36 | |||
| 37 | foreach(t IN LISTS TEST_EXES) | ||
| 38 | target_link_libraries(${t} DirectX-Headers DirectX-Guids ${dxlibs}) | ||
| 39 | endforeach() | ||
| 40 | |||
| 41 | if(DXHEADERS_BUILD_COM_ATL) | ||
| 42 | foreach(t IN LISTS TEST_EXES) | ||
| 43 | target_compile_definitions(${t} PRIVATE D3DX12_USE_ATL) | ||
| 44 | endforeach() | ||
| 45 | endif() | ||
| 46 | |||
| 47 | if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM" ) | ||
| 48 | target_compile_options(DirectX-Headers-Check-Feature-Support-Test PRIVATE -Wno-unused-variable) | ||
| 49 | endif() | ||
| 50 | |||
| 51 | if(WIN32) | ||
| 52 | foreach(t IN LISTS TEST_EXES) | ||
| 53 | target_compile_definitions(${t} PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00) | ||
| 54 | endforeach() | ||
| 55 | |||
| 56 | if(WINDOWS_STORE) | ||
| 57 | foreach(t IN LISTS TEST_EXES) | ||
| 58 | target_compile_definitions(${t} PRIVATE WINAPI_FAMILY=WINAPI_FAMILY_APP) | ||
| 59 | endforeach() | ||
| 60 | endif() | ||
| 61 | endif() | ||
