Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit e14b209

Browse files
committed
Update CMake files for latest compiler
1 parent fff529a commit e14b209

File tree

26 files changed

+335
-0
lines changed

26 files changed

+335
-0
lines changed

AdaptiveTessellationCS40/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
106106
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
107107
endif()
108108

109+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
110+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
111+
endif()
112+
109113
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
110114
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
111115
endif()
116+
117+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
118+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
119+
endif()
112120
endif()
113121

114122
if(WIN32)

BasicCompute11/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
9292
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
9393
endif()
9494

95+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
96+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
97+
endif()
98+
9599
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
96100
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
97101
endif()
102+
103+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
104+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
105+
endif()
98106
endif()
99107

100108
if(WIN32)

BasicHLSL11/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
100100
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
101101
endif()
102102

103+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
104+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
105+
endif()
106+
103107
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
104108
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
105109
endif()
110+
111+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
112+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
113+
endif()
106114
endif()
107115

108116
if(WIN32)

BasicHLSLFX11/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
103103
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
104104
endif()
105105

106+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
107+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
108+
endif()
109+
106110
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
107111
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
108112
endif()
113+
114+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
115+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
116+
endif()
109117
endif()
110118

111119
if(WIN32)

CMakePresets.json

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"version": 2,
3+
"configurePresets": [
4+
{
5+
"name": "base",
6+
"displayName": "Basic Config",
7+
"description": "Basic build using Ninja generator",
8+
"generator": "Ninja",
9+
"hidden": true,
10+
"binaryDir": "${sourceDir}/out/build/${presetName}",
11+
"cacheVariables": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" }
12+
},
13+
14+
{
15+
"name": "x64",
16+
"architecture": {
17+
"value": "x64",
18+
"strategy": "external"
19+
},
20+
"cacheVariables": { "DIRECTX_ARCH": "x64" },
21+
"hidden": true
22+
},
23+
{
24+
"name": "x86",
25+
"architecture": {
26+
"value": "x86",
27+
"strategy": "external"
28+
},
29+
"cacheVariables": { "DIRECTX_ARCH": "x86" },
30+
"hidden": true
31+
},
32+
{
33+
"name": "ARM64",
34+
"architecture": {
35+
"value": "arm64",
36+
"strategy": "external"
37+
},
38+
"cacheVariables": { "DIRECTX_ARCH": "arm64" },
39+
"hidden": true
40+
},
41+
42+
{
43+
"name": "Debug",
44+
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" },
45+
"hidden": true
46+
},
47+
{
48+
"name": "Release",
49+
"cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" },
50+
"hidden": true
51+
},
52+
53+
{
54+
"name": "MSVC",
55+
"hidden": true,
56+
"cacheVariables": {
57+
"CMAKE_CXX_COMPILER": "cl.exe"
58+
},
59+
"toolset": {
60+
"value": "host=x64",
61+
"strategy": "external"
62+
}
63+
},
64+
{
65+
"name": "Clang",
66+
"hidden": true,
67+
"cacheVariables": {
68+
"CMAKE_CXX_COMPILER": "clang-cl.exe"
69+
},
70+
"toolset": {
71+
"value": "host=x64",
72+
"strategy": "external"
73+
}
74+
},
75+
{
76+
"name": "GNUC",
77+
"hidden": true,
78+
"cacheVariables": {
79+
"CMAKE_CXX_COMPILER": "g++.exe"
80+
},
81+
"toolset": {
82+
"value": "host=x64",
83+
"strategy": "external"
84+
}
85+
},
86+
87+
{
88+
"name": "VCPKG",
89+
"cacheVariables": {
90+
"CMAKE_TOOLCHAIN_FILE": {
91+
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
92+
"type": "FILEPATH"
93+
}
94+
},
95+
"hidden": true
96+
},
97+
{
98+
"name": "MinGW32",
99+
"hidden": true,
100+
"environment": {
101+
"PATH": "$penv{PATH};c:/mingw32/bin"
102+
},
103+
"cacheVariables": {
104+
"VCPKG_TARGET_TRIPLET": "x86-mingw-static",
105+
"VCPKG_HOST_TRIPLET": "x86-mingw-static"
106+
}
107+
},
108+
{
109+
"name": "MinGW64",
110+
"hidden": true,
111+
"environment": {
112+
"PATH": "$penv{PATH};c:/mingw64/bin"
113+
},
114+
"cacheVariables": {
115+
"VCPKG_TARGET_TRIPLET": "x64-mingw-static",
116+
"VCPKG_HOST_TRIPLET": "x64-mingw-static"
117+
}
118+
},
119+
120+
{ "name": "x64-Debug" , "description": "MSVC for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "MSVC", "VCPKG" ] },
121+
{ "name": "x64-Release" , "description": "MSVC for x64 (Release)", "inherits": [ "base", "x64", "Release", "MSVC", "VCPKG" ] },
122+
{ "name": "x86-Debug" , "description": "MSVC for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "MSVC", "VCPKG" ] },
123+
{ "name": "x86-Release" , "description": "MSVC for x86 (Release)", "inherits": [ "base", "x86", "Release", "MSVC", "VCPKG" ] },
124+
{ "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) for Windows 10", "inherits": [ "base", "ARM64", "Debug", "MSVC", "VCPKG" ] },
125+
{ "name": "arm64-Release", "description": "MSVC for ARM64 (Release) for Windows 10", "inherits": [ "base", "ARM64", "Release", "MSVC", "VCPKG" ] },
126+
127+
{ "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "Clang", "VCPKG" ] },
128+
{ "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang", "VCPKG" ] },
129+
{ "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
130+
{ "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
131+
{ "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for Windows 10", "inherits": [ "base", "ARM64", "Debug", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
132+
{ "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release) for Windows 10", "inherits": [ "base", "ARM64", "Release", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
133+
134+
{ "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "MinGW64" ] },
135+
{ "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "MinGW64" ] },
136+
{ "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "MinGW32" ] },
137+
{ "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "MinGW32" ] }
138+
]
139+
}

ComputeShaderSort11/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
9292
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
9393
endif()
9494

95+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
96+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
97+
endif()
98+
9599
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
96100
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
97101
endif()
102+
103+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
104+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
105+
endif()
98106
endif()
99107

100108
if(WIN32)

Direct3D11Tutorials/Tutorial01/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
100100
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
101101
endif()
102102

103+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
104+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
105+
endif()
106+
103107
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
104108
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
105109
endif()
110+
111+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
112+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
113+
endif()
106114
endif()
107115

108116
if(WIN32)

Direct3D11Tutorials/Tutorial02/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
103103
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
104104
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
105105
endif()
106+
107+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
108+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
109+
endif()
106110
endif()
107111

108112
if(WIN32)

Direct3D11Tutorials/Tutorial03/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
100100
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
101101
endif()
102102

103+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
104+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
105+
endif()
106+
103107
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
104108
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
105109
endif()
110+
111+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
112+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
113+
endif()
106114
endif()
107115

108116
if(WIN32)

Direct3D11Tutorials/Tutorial04/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
100100
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
101101
endif()
102102

103+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
104+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
105+
endif()
106+
103107
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
104108
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
105109
endif()
110+
111+
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
112+
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
113+
endif()
106114
endif()
107115

108116
if(WIN32)

0 commit comments

Comments
 (0)