From 863fd3154a067cb6819cbceb3dd0f92659bf0ebb Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Fri, 16 Aug 2024 18:13:35 -0700 Subject: [PATCH] More cmake updates --- CMakeLists.txt | 2 +- Texconv/PortablePixMap.cpp | 3 ++- build/CompilerAndLinker.cmake | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dc069a8..7f240c67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -591,7 +591,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") endforeach() endif() - set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4514" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4711" "/wd4751" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219") + set(WarningsEXE "/wd4061" "/wd4062" "/wd4365" "/wd4514" "/wd4571" "/wd4625" "/wd4626" "/wd4627" "/wd4668" "/wd4710" "/wd4711" "/wd4751" "/wd4774" "/wd4820" "/wd5026" "/wd5027" "/wd5039" "/wd5045" "/wd5219") if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.34) list(APPEND WarningsEXE "/wd5262" "/wd5264") endif() diff --git a/Texconv/PortablePixMap.cpp b/Texconv/PortablePixMap.cpp index 9501c43b..a360c48c 100644 --- a/Texconv/PortablePixMap.cpp +++ b/Texconv/PortablePixMap.cpp @@ -14,7 +14,7 @@ #pragma warning(disable : 4005) #endif #define WIN32_LEAN_AND_MEAN -#define NOMINMAX +#define NOMINMAX 1 #define NODRAWTEXT #define NOMCX #define NOSERVICE @@ -25,6 +25,7 @@ #include +#include #include #include #include diff --git a/build/CompilerAndLinker.cmake b/build/CompilerAndLinker.cmake index 120a7fe9..da8b659d 100644 --- a/build/CompilerAndLinker.cmake +++ b/build/CompilerAndLinker.cmake @@ -123,6 +123,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") list(APPEND COMPILER_SWITCHES /Zc:lambda) endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.29) + list(APPEND COMPILER_SWITCHES /external:W4) + endif() + if((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.31) AND (XBOX_CONSOLE_TARGET STREQUAL "durango")) list(APPEND COMPILER_SWITCHES /Zc:static_assert-)