File: CMakeLists.txt

package info (click to toggle)
directx-headers 1.614.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,932 kB
  • sloc: ansic: 45,008; cpp: 10,581; makefile: 5
file content (45 lines) | stat: -rw-r--r-- 1,408 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
include(FetchContent)

set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_Declare(
    googletest
    GIT_REPOSITORY https://github.com/google/googletest.git
    GIT_TAG main # Live at head
)
FetchContent_MakeAvailable(googletest)

list(APPEND dxlibs "")
if(EXISTS "/usr/lib/wsl/lib/")
  find_library(libd3d12 d3d12 HINTS /usr/lib/wsl/lib)
  list(APPEND dxlibs ${libd3d12})
else()
# Fallback to default: let CMake look for libs
  list(APPEND dxlibs d3d12)
endif()

project(DirectX-Headers-GoogleTest-Suite
  DESCRIPTION "DirectX-Header tests using GooleTest"
  HOMEPAGE_URL "https://github.com/microsoft/DirectX-Headers/"
  LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

add_executable(Feature-Support-Test feature_support_test.cpp)
target_link_libraries(Feature-Support-Test DirectX-Headers DirectX-Guids ${dxlibs} gtest_main)
add_test(Feature-Support-Test Feature-Support-Test)

if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
    target_compile_options(Feature-Support-Test PRIVATE -Wno-unused-variable)
endif()

if(WIN32)
    target_compile_definitions(Feature-Support-Test PRIVATE _UNICODE UNICODE _WIN32_WINNT=0x0A00)

    if(WINDOWS_STORE)
      target_compile_definitions(Feature-Support-Test PRIVATE WINAPI_FAMILY=WINAPI_FAMILY_APP)
    endif()
endif()