[BE]: Fix CMake LTO policy on pytorch (#93388)

Not this is a non-functional change since non of our CIs actually build with LTO.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/93388
Approved by: https://github.com/albanD
This commit is contained in:
Aaron Gokaslan 2023-02-01 17:06:53 +00:00 committed by PyTorch MergeBot
parent bf2e2fea41
commit 2fc2ca7652

View file

@ -8,6 +8,12 @@ cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
cmake_policy(SET CMP0010 NEW)
cmake_policy(SET CMP0025 NEW)
# Enables CMake to set LTO on compilers other than Intel.
cmake_policy(SET CMP0069 NEW)
# Enable the policy for CMake subprojects.
# protobuf currently causes issues
#set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
# Suppress warning flags in default MSVC configuration. It's not
# mandatory that we do this (and we don't if cmake is old), but it's
# nice when it's possible, and it's possible on our Windows configs.