Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Update CMake files for latest compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Feb 25, 2023
1 parent fff529a commit c740831
Show file tree
Hide file tree
Showing 27 changed files with 335 additions and 1 deletion.
8 changes: 8 additions & 0 deletions AdaptiveTessellationCS40/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions BasicCompute11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions BasicHLSL11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions BasicHLSLFX11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
139 changes: 139 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"version": 2,
"configurePresets": [
{
"name": "base",
"displayName": "Basic Config",
"description": "Basic build using Ninja generator",
"generator": "Ninja",
"hidden": true,
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" }
},

{
"name": "x64",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": { "DIRECTX_ARCH": "x64" },
"hidden": true
},
{
"name": "x86",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": { "DIRECTX_ARCH": "x86" },
"hidden": true
},
{
"name": "ARM64",
"architecture": {
"value": "arm64",
"strategy": "external"
},
"cacheVariables": { "DIRECTX_ARCH": "arm64" },
"hidden": true
},

{
"name": "Debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" },
"hidden": true
},
{
"name": "Release",
"cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo" },
"hidden": true
},

{
"name": "MSVC",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "cl.exe"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},
{
"name": "Clang",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clang-cl.exe"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},
{
"name": "GNUC",
"hidden": true,
"cacheVariables": {
"CMAKE_CXX_COMPILER": "g++.exe"
},
"toolset": {
"value": "host=x64",
"strategy": "external"
}
},

{
"name": "VCPKG",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"type": "FILEPATH"
}
},
"hidden": true
},
{
"name": "MinGW32",
"hidden": true,
"environment": {
"PATH": "$penv{PATH};c:/mingw32/bin"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x86-mingw-static",
"VCPKG_HOST_TRIPLET": "x86-mingw-static"
}
},
{
"name": "MinGW64",
"hidden": true,
"environment": {
"PATH": "$penv{PATH};c:/mingw64/bin"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-mingw-static",
"VCPKG_HOST_TRIPLET": "x64-mingw-static"
}
},

{ "name": "x64-Debug" , "description": "MSVC for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "MSVC", "VCPKG" ] },
{ "name": "x64-Release" , "description": "MSVC for x64 (Release)", "inherits": [ "base", "x64", "Release", "MSVC", "VCPKG" ] },
{ "name": "x86-Debug" , "description": "MSVC for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "MSVC", "VCPKG" ] },
{ "name": "x86-Release" , "description": "MSVC for x86 (Release)", "inherits": [ "base", "x86", "Release", "MSVC", "VCPKG" ] },
{ "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug) for Windows 10", "inherits": [ "base", "ARM64", "Debug", "MSVC", "VCPKG" ] },
{ "name": "arm64-Release", "description": "MSVC for ARM64 (Release) for Windows 10", "inherits": [ "base", "ARM64", "Release", "MSVC", "VCPKG" ] },

{ "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "Clang", "VCPKG" ] },
{ "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang", "VCPKG" ] },
{ "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
{ "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang", "VCPKG" ], "environment": { "CXXFLAGS": "-m32" } },
{ "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" } },
{ "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" } },

{ "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC", "VCPKG", "MinGW64" ] },
{ "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC", "VCPKG", "MinGW64" ] },
{ "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC", "VCPKG", "MinGW32" ] },
{ "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC", "VCPKG", "MinGW32" ] }
]
}
8 changes: 8 additions & 0 deletions ComputeShaderSort11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,17 @@ elseif( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11Tutorials/Tutorial01/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
4 changes: 4 additions & 0 deletions Direct3D11Tutorials/Tutorial02/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11Tutorials/Tutorial03/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11Tutorials/Tutorial04/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11Tutorials/Tutorial05/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11Tutorials/Tutorial06/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11Tutorials/Tutorial07/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11TutorialsDXUT/Tutorial08/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
8 changes: 8 additions & 0 deletions Direct3D11TutorialsDXUT/Tutorial09/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ elseif ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
target_link_options(${PROJECT_NAME} PRIVATE /CETCOMPAT)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.28)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:lambda)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34)
target_compile_options(${PROJECT_NAME} PRIVATE /wd5262 /wd5264)
endif()

if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.35)
target_compile_options(${PROJECT_NAME} PRIVATE /Zc:templateScope)
endif()
endif()

if(WIN32)
Expand Down
Loading

0 comments on commit c740831

Please sign in to comment.