From 036f82f39be463de8b0342417bd57ef2c6560936 Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Tue, 11 Feb 2025 14:40:52 -0800 Subject: [PATCH 1/2] [BUILD] Enable old behavior of CMP0092 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88709cf564..87378cc795 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,12 @@ if(POLICY CMP0091) cmake_policy(SET CMP0091 NEW) endif() +if(POLICY CMP0092) + # https://cmake.org/cmake/help/latest/policy/CMP0092.html#policy:CMP0092 + # Make sure the /W3 is not removed from CMAKE_CXX_FLAGS since CMake 3.15 + cmake_policy(SET CMP0092 OLD) +endif() + # MSVC RTTI flag /GR should not be not added to CMAKE_CXX_FLAGS by default. @see # https://cmake.org/cmake/help/latest/policy/CMP0117.html if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.20.0") From ec1b19215c228459445d904f68dcba362618083f Mon Sep 17 00:00:00 2001 From: Tom Tan Date: Wed, 12 Feb 2025 10:40:18 -0800 Subject: [PATCH 2/2] Format --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87378cc795..80e5b81a14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ if(POLICY CMP0091) endif() if(POLICY CMP0092) - # https://cmake.org/cmake/help/latest/policy/CMP0092.html#policy:CMP0092 - # Make sure the /W3 is not removed from CMAKE_CXX_FLAGS since CMake 3.15 + # https://cmake.org/cmake/help/latest/policy/CMP0092.html#policy:CMP0092 Make + # sure the /W3 is not removed from CMAKE_CXX_FLAGS since CMake 3.15 cmake_policy(SET CMP0092 OLD) endif()