Unverified Commit 7d37f2a6 authored by yaakovschectman's avatar yaakovschectman Committed by GitHub

Opt into CMake policy CMP0135 (#125502)

~Update the windows app template and migration to use `CMP0135` when
cmake version is >= 3.24.~

Update app templates' and examples' CMakeLists.txt to use
`cmake_policy(VERSION`. https://github.com/flutter/packages/pull/3828
should obviate the need for a migration.

Addresses https://github.com/flutter/flutter/issues/116866

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
parent af050d95
...@@ -12,7 +12,7 @@ set(BINARY_NAME "complex_layout") ...@@ -12,7 +12,7 @@ set(BINARY_NAME "complex_layout")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -3,7 +3,7 @@ project(flutter_gallery LANGUAGES CXX) ...@@ -3,7 +3,7 @@ project(flutter_gallery LANGUAGES CXX)
set(BINARY_NAME "flutter_gallery") set(BINARY_NAME "flutter_gallery")
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
......
...@@ -8,7 +8,7 @@ set(BINARY_NAME "ui") ...@@ -8,7 +8,7 @@ set(BINARY_NAME "ui")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -8,7 +8,7 @@ set(BINARY_NAME "windows_startup_test") ...@@ -8,7 +8,7 @@ set(BINARY_NAME "windows_startup_test")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -3,7 +3,7 @@ project(manual_tests LANGUAGES CXX) ...@@ -3,7 +3,7 @@ project(manual_tests LANGUAGES CXX)
set(BINARY_NAME "manual_tests") set(BINARY_NAME "manual_tests")
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
......
...@@ -3,7 +3,7 @@ project(dartpad_curve2_d_0 LANGUAGES CXX) ...@@ -3,7 +3,7 @@ project(dartpad_curve2_d_0 LANGUAGES CXX)
set(BINARY_NAME "dartpad_curve2_d_0") set(BINARY_NAME "dartpad_curve2_d_0")
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
......
...@@ -12,7 +12,7 @@ set(BINARY_NAME "flutter_view") ...@@ -12,7 +12,7 @@ set(BINARY_NAME "flutter_view")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -8,7 +8,7 @@ set(BINARY_NAME "hello_world") ...@@ -8,7 +8,7 @@ set(BINARY_NAME "hello_world")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -8,7 +8,7 @@ set(BINARY_NAME "platform_channel") ...@@ -8,7 +8,7 @@ set(BINARY_NAME "platform_channel")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -12,7 +12,7 @@ set(BINARY_NAME "platform_view") ...@@ -12,7 +12,7 @@ set(BINARY_NAME "platform_view")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -8,7 +8,7 @@ set(BINARY_NAME "{{projectName}}") ...@@ -8,7 +8,7 @@ set(BINARY_NAME "{{projectName}}")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake. # versions of CMake.
cmake_policy(SET CMP0063 NEW) cmake_policy(VERSION 3.14...3.25)
# Define build configuration option. # Define build configuration option.
get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
......
...@@ -8,6 +8,10 @@ cmake_minimum_required(VERSION 3.14) ...@@ -8,6 +8,10 @@ cmake_minimum_required(VERSION 3.14)
set(PROJECT_NAME "{{projectName}}") set(PROJECT_NAME "{{projectName}}")
project(${PROJECT_NAME} LANGUAGES CXX) project(${PROJECT_NAME} LANGUAGES CXX)
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
cmake_policy(VERSION 3.14...3.25)
# This value is used when generating builds using this plugin, so it must # This value is used when generating builds using this plugin, so it must
# not be changed # not be changed
set(PLUGIN_NAME "{{projectName}}_plugin") set(PLUGIN_NAME "{{projectName}}_plugin")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment