From 2209fb84c20dd2f04241755c6aa79cccc00622c8 Mon Sep 17 00:00:00 2001 From: Miroslaw Opoka Date: Tue, 19 May 2026 19:28:44 +0000 Subject: [PATCH] fix: bump cmake_policy VERSION to 3.10 for CMake 4.x compatibility CMake 4.x removed support for cmake_policy(VERSION) below 3.5 and warns about versions below 3.10. Update all script templates and the main toolchain file to declare VERSION 3.10. --- Arduino-toolchain.cmake | 2 +- Arduino/Templates/Scripts/BuildRuleScript.cmake.in | 2 +- Arduino/Templates/Scripts/LinkScript.cmake.in | 2 +- Arduino/Templates/Scripts/ToolScript.cmake.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Arduino-toolchain.cmake b/Arduino-toolchain.cmake index 10634c0..195abcc 100644 --- a/Arduino-toolchain.cmake +++ b/Arduino-toolchain.cmake @@ -34,7 +34,7 @@ endif() cmake_policy(PUSH) # Set policy to above 3.0.0 -cmake_policy(VERSION 3.0.0) +cmake_policy(VERSION 3.10) # Interpret if() arguments without quotes as variables/keywords if (NOT CMAKE_VERSION VERSION_LESS 3.1) diff --git a/Arduino/Templates/Scripts/BuildRuleScript.cmake.in b/Arduino/Templates/Scripts/BuildRuleScript.cmake.in index 0ea16e4..a5884dc 100644 --- a/Arduino/Templates/Scripts/BuildRuleScript.cmake.in +++ b/Arduino/Templates/Scripts/BuildRuleScript.cmake.in @@ -1,6 +1,6 @@ # Copyright (c) 2020 Arduino CMake Toolchain -cmake_policy(VERSION 3.0) +cmake_policy(VERSION 3.10) set(ARDUINO_TOOLCHAIN_DIR "@ARDUINO_TOOLCHAIN_DIR@") set(ARDUINO_PATTERN_NAMES diff --git a/Arduino/Templates/Scripts/LinkScript.cmake.in b/Arduino/Templates/Scripts/LinkScript.cmake.in index bfe4822..a45ac90 100644 --- a/Arduino/Templates/Scripts/LinkScript.cmake.in +++ b/Arduino/Templates/Scripts/LinkScript.cmake.in @@ -1,6 +1,6 @@ # Copyright (c) 2020 Arduino CMake Toolchain -cmake_policy(VERSION 3.0) +cmake_policy(VERSION 3.10) # Generated content based on the selected board set(ARDUINO_TOOLCHAIN_DIR "@ARDUINO_TOOLCHAIN_DIR@") diff --git a/Arduino/Templates/Scripts/ToolScript.cmake.in b/Arduino/Templates/Scripts/ToolScript.cmake.in index 499c2c9..e44db20 100644 --- a/Arduino/Templates/Scripts/ToolScript.cmake.in +++ b/Arduino/Templates/Scripts/ToolScript.cmake.in @@ -1,6 +1,6 @@ # Copyright (c) 2020 Arduino CMake Toolchain -cmake_policy(VERSION 3.1) +cmake_policy(VERSION 3.10) # Generated content based on the selected board set(ARDUINO_TOOLCHAIN_DIR "@ARDUINO_TOOLCHAIN_DIR@")