From 1a0c980fce8407ae5fced0a592cf56010770f7a7 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 11 May 2022 16:12:23 -0700 Subject: [PATCH] CMake Presets added for Intel compilers (#64) --- CMakePresets.json | 52 ++++++++++++++++++++++++++++++++++++++------- test/CMakeLists.txt | 2 +- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index d1a8f15..c114cf7 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -60,7 +60,8 @@ "name": "MSVC", "hidden": true, "cacheVariables": { - "CMAKE_CXX_COMPILER": "cl.exe" + "CMAKE_CXX_COMPILER": "cl.exe", + "CMAKE_C_COMPILER": "cl.exe" }, "toolset": { "value": "host=x64", @@ -80,7 +81,7 @@ } }, { - "name": "MinGW", + "name": "GNUC", "hidden": true, "cacheVariables": { "CMAKE_CXX_COMPILER": "g++.exe", @@ -92,6 +93,31 @@ "strategy": "external" } }, + { + "name": "Intel", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "icl.exe", + "DXHEADERS_BUILD_GOOGLE_TEST": false, + "DXHEADERS_BUILD_TEST": false + }, + "toolset": { + "value": "host=x64", + "strategy": "external" + } + }, + { + "name": "IntelLLVM", + "hidden": true, + "cacheVariables": { + "CMAKE_CXX_COMPILER": "icx.exe", + "DXHEADERS_BUILD_GOOGLE_TEST": false + }, + "toolset": { + "value": "host=x64", + "strategy": "external" + } + }, { "name": "UWP", @@ -130,13 +156,23 @@ { "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang" ] }, { "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, { "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang" ], "environment": { "CXXFLAGS": "-m32" } }, - { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug) - ARM-NEON", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, - { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release) - ARM-NEON", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, + { "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, + { "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }, + + { "name": "x64-Debug-ICC" , "description": "Intel Classic Compiler (Debug)", "inherits": [ "base", "x64", "Debug", "Intel" ] }, + { "name": "x64-Release-ICC" , "description": "Intel Classic Compiler (Release)", "inherits": [ "base", "x64", "Release", "Intel" ] }, + { "name": "x86-Debug-ICC" , "description": "Intel Classic Compiler (Debug)", "inherits": [ "base", "x86", "Debug", "Intel" ] }, + { "name": "x86-Release-ICC" , "description": "Intel Classic Compiler (Release)", "inherits": [ "base", "x86", "Release", "Intel" ] }, + + { "name": "x64-Debug-ICX" , "description": "Intel oneAPI Compiler (Debug)", "inherits": [ "base", "x64", "Debug", "IntelLLVM" ] }, + { "name": "x64-Release-ICX" , "description": "Intel oneAPI Compiler (Release)", "inherits": [ "base", "x64", "Release", "IntelLLVM" ] }, + { "name": "x86-Debug-ICX" , "description": "Intel oneAPI Compiler (Debug)", "inherits": [ "base", "x86", "Debug", "IntelLLVM" ] }, + { "name": "x86-Release-ICX" , "description": "Intel oneAPI Compiler (Release)", "inherits": [ "base", "x86", "Release", "IntelLLVM" ] }, - { "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "MinGW" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, - { "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "MinGW" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, - { "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "MinGW" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, - { "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "MinGW" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, + { "name": "x64-Debug-MinGW" , "description": "MinG-W64 (Debug)", "inherits": [ "base", "x64", "Debug", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, + { "name": "x64-Release-MinGW", "description": "MinG-W64 (Release)", "inherits": [ "base", "x64", "Release", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw64/bin" } }, + { "name": "x86-Debug-MinGW" , "description": "MinG-W32 (Debug)", "inherits": [ "base", "x86", "Debug", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, + { "name": "x86-Release-MinGW", "description": "MinG-W32 (Release)", "inherits": [ "base", "x86", "Release", "GNUC" ], "environment": { "PATH": "$penv{PATH};c:/mingw32/bin" } }, { "name": "x64-Debug-WSL" , "description": "WSL x64 (Debug) for Windows 11", "inherits": [ "base", "x64", "Debug" ] }, { "name": "x64-Release-WSL" , "description": "WSL x64 (Release) for Windows 11", "inherits": [ "base", "x64", "Release" ] }, diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 9825a13..5f384be 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -31,7 +31,7 @@ foreach(t IN LISTS TEST_EXES) target_link_libraries(${t} DirectX-Headers DirectX-Guids ${dxlibs}) endforeach() -if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) +if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM" ) target_compile_options(DirectX-Headers-Check-Feature-Support-Test PRIVATE -Wno-unused-variable) endif()