cmake: add a mechanism for deprecating modules
We currently have mechanisms for deprecating both boards and SoCs. However, we lack one for deprecating modules. This is inconvenient, because we would like to do exactly that. Handle this in a simple way by adding a new CMake file in the modules directory which is responsible for warning the user about any deprecated modules they may be using. See the source code comments for more details about the approach. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
0813966545
commit
dcec8d028a
2 changed files with 15 additions and 0 deletions
|
@ -1824,6 +1824,8 @@ if(CONFIG_SOC_DEPRECATED_RELEASE)
|
|||
)
|
||||
endif()
|
||||
|
||||
include(modules/deprecation_warnings.cmake)
|
||||
|
||||
# In CMake projects, 'CMAKE_BUILD_TYPE' usually determines the
|
||||
# optimization flag, but in Zephyr it is determined through
|
||||
# Kconfig. Here we give a warning when there is a mismatch between the
|
||||
|
|
13
modules/deprecation_warnings.cmake
Normal file
13
modules/deprecation_warnings.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Copyright 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# This file is included to warn the user about any deprecated modules
|
||||
# they are using. To create a warning, follow the pattern:
|
||||
#
|
||||
# if(CONFIG_FOO)
|
||||
# message(WARNING "The foo module is deprecated. <More information>")
|
||||
# endif()
|
||||
#
|
||||
# This is done in a separate CMake file because the modules.cmake file
|
||||
# in this same directory is evaluated before Kconfig runs.
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue