From 20e2318b9fe9613308b53321ac7f9d6ef481144e Mon Sep 17 00:00:00 2001 From: Attie Grande Date: Tue, 16 Jan 2024 17:24:54 +0000 Subject: [PATCH] cmake: hex: deprecate use of to_hex() and from_hex() utility functions Since v3.13, CMake has supported math(... OUTPUT_FORMAT ) and 0x prefixes on numbers, which together provides the same functionality as to_hex() and from_hex() that we've previously maintained. Users should switch to using math() instead, and our functions are now marked as deprecated. Signed-off-by: Attie Grande --- cmake/hex.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/hex.cmake b/cmake/hex.cmake index c3935f613fd..f5eb586f7bd 100644 --- a/cmake/hex.cmake +++ b/cmake/hex.cmake @@ -1,5 +1,9 @@ # SPDX-License-Identifier: Apache-2.0 +# This code was deprecated after Zephyr v3.5.0 +message(DEPRECATION "The to_hex() and from_hex() functions are deprecated. Please " + "use CMake's math(... OUTPUT_FORMAT ) instead.") + # from https://gist.github.com/korzo89/71a6de0f388f7cf8b349101b0134060c function(from_hex HEX DEC) string(SUBSTRING "${HEX}" 2 -1 HEX)