-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
68 lines (49 loc) · 2.38 KB
/
CMakeLists.txt
File metadata and controls
68 lines (49 loc) · 2.38 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.26)
message(STATUS "CMAKE version: ${CMAKE_VERSION}")
project(
ShaderTestingFramework
VERSION 0.1.0
DESCRIPTION "A testing framework for shader code"
LANGUAGES CXX )
if(CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_VS_VERSION_BUILD_NUMBER VERSION_LESS "17.7")
message(FATAL_ERROR "Shader Test Framework requires at least Visual Studio 17.7. You have ${CMAKE_VS_VERSION_BUILD_NUMBER} installed. Please update your installation of VS 2022 to latest")
endif()
if(NOT MSVC)
message(FATAL_ERROR "Shader Test Framework requires the MSVC compiler. If you are using Ninja as the generator, set cl as the value of CMAKE_CXX_COMPILER")
endif()
if(MSVC_VERSION VERSION_LESS 1937)
message(FATAL_ERROR "Shader Test Framework requires at least MSVC 1937 (Visual Studio 2022 17.7 ). You have ${MSVC_VERSION} installed. Please update your installation of VS 2022 to latest or if you have a later version installed point CMake to it using the toolset configuration preset.")
endif()
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 23)
option(STF_ENABLE_TESTING "Enable Test Project")
option(STF_INCLUDE_EXAMPLES "Include and build examples")
option(STF_DISABLE_UNITY_STF "Disable Unity build for STF Targets")
option(STF_STRICT_COMPILATION "Turn Warning Level Up and Warnings as Errors")
include(Configuration)
addDynamicDebuggingConfig()
if (${STF_STRICT_COMPILATION})
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(GLOBAL_COMPILE_FLAGS /W4)
list(APPEND GLOBAL_COMPILE_FLAGS
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:
# We need to disable this because of a known issue in Clang https://github.com/llvm/llvm-project/issues/51619
# This warning basically makes it impossible to use tuplet as it is implemented as an aggregate.
-Wno-missing-braces
## We need to disable this because of an issue in PixEvents.
## We can remove this when https://github.com/microsoft/PixEvents/pull/11 is resolved
-Wno-unused-but-set-variable
>)
endif()
add_subdirectory(src)
if (${STF_ENABLE_TESTING} OR ${STF_INCLUDE_EXAMPLES})
enable_testing()
if(${STF_ENABLE_TESTING})
add_subdirectory(test)
endif()
if(${STF_INCLUDE_EXAMPLES})
add_subdirectory(examples)
endif()
endif()