diff --git a/cmake/modules/FindDeprecated.cmake b/cmake/modules/FindDeprecated.cmake index 27f2165033c8..d593846afc78 100644 --- a/cmake/modules/FindDeprecated.cmake +++ b/cmake/modules/FindDeprecated.cmake @@ -68,6 +68,16 @@ if("CROSS_COMPILE" IN_LIST Deprecated_FIND_COMPONENTS) endif() endif() +if("XTOOLS" IN_LIST Deprecated_FIND_COMPONENTS) + list(REMOVE_ITEM Deprecated_FIND_COMPONENTS XTOOLS) + # This code was deprecated after Zephyr v3.3.0 + # When removing support for `xtools`, remember to also remove: + # cmake/toolchain/xtools (folder with files) + # doc/develop/toolchains/crosstool_ng.rst and update the index.rst file. + message(DEPRECATION "XTOOLS toolchain variant is deprecated. " + "Please set ZEPHYR_TOOLCHAIN_VARIANT to 'zephyr'") +endif() + if(NOT "${Deprecated_FIND_COMPONENTS}" STREQUAL "") message(STATUS "The following deprecated component(s) could not be found: " "${Deprecated_FIND_COMPONENTS}") diff --git a/cmake/toolchain/xtools/generic.cmake b/cmake/toolchain/xtools/generic.cmake index bec6bd09c0ec..be0075adede9 100644 --- a/cmake/toolchain/xtools/generic.cmake +++ b/cmake/toolchain/xtools/generic.cmake @@ -1,5 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 +find_package(Deprecated COMPONENTS XTOOLS) + zephyr_get(XTOOLS_TOOLCHAIN_PATH) assert( XTOOLS_TOOLCHAIN_PATH "XTOOLS_TOOLCHAIN_PATH is not set")