aboutsummaryrefslogtreecommitdiff
path: root/contrib/DirectX-Headers-1.618.2/googletest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/DirectX-Headers-1.618.2/googletest/CMakeLists.txt')
-rw-r--r--contrib/DirectX-Headers-1.618.2/googletest/CMakeLists.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/contrib/DirectX-Headers-1.618.2/googletest/CMakeLists.txt b/contrib/DirectX-Headers-1.618.2/googletest/CMakeLists.txt
new file mode 100644
index 0000000..ff979d9
--- /dev/null
+++ b/contrib/DirectX-Headers-1.618.2/googletest/CMakeLists.txt
@@ -0,0 +1,45 @@
1# Copyright (c) Microsoft Corporation.
2# Licensed under the MIT License.
3include(FetchContent)
4
5set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
6FetchContent_Declare(
7 googletest
8 GIT_REPOSITORY https://github.com/google/googletest.git
9 GIT_TAG main # Live at head
10)
11FetchContent_MakeAvailable(googletest)
12
13list(APPEND dxlibs "")
14if(EXISTS "/usr/lib/wsl/lib/")
15 find_library(libd3d12 d3d12 HINTS /usr/lib/wsl/lib)
16 list(APPEND dxlibs ${libd3d12})
17else()
18# Fallback to default: let CMake look for libs
19 list(APPEND dxlibs d3d12)
20endif()
21
22project(DirectX-Headers-GoogleTest-Suite
23 DESCRIPTION "DirectX-Header tests using GooleTest"
24 HOMEPAGE_URL "https://github.com/microsoft/DirectX-Headers/"
25 LANGUAGES CXX)
26
27set(CMAKE_CXX_STANDARD 17)
28set(CMAKE_CXX_STANDARD_REQUIRED ON)
29set(CMAKE_CXX_EXTENSIONS OFF)
30
31add_executable(Feature-Support-Test feature_support_test.cpp)
32target_link_libraries(Feature-Support-Test DirectX-Headers DirectX-Guids ${dxlibs} gtest_main)
33add_test(Feature-Support-Test Feature-Support-Test)
34
35if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
36 target_compile_options(Feature-Support-Test PRIVATE -Wno-unused-variable)
37endif()
38
39if(WIN32)
40 target_compile_definitions(Feature-Support-Test PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00)
41
42 if(WINDOWS_STORE)
43 target_compile_definitions(Feature-Support-Test PRIVATE WINAPI_FAMILY=WINAPI_FAMILY_APP)
44 endif()
45endif()