mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(cmakev2/project): add warning for usage of deprecated variables
The COMPONENTS and EXCLUDE_COMPONENTS variables are unused in cmakev2. A deprecation warning will be printed if they are set. This change also includes a helper functions for printing deprecation warnings. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -109,6 +109,40 @@ function(idf_dbg)
|
||||
message(DEBUG " IDF: ${joined}")
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
idf_deprecated(<msg>...)
|
||||
|
||||
*msg[in]*
|
||||
|
||||
Message to print.
|
||||
|
||||
Print deprecated ``<msg>``. Multiple messages are concatenated into a
|
||||
single message with no separator between them.
|
||||
#]]
|
||||
function(idf_deprecated)
|
||||
set(joined "")
|
||||
math(EXPR last "${ARGC} - 1")
|
||||
foreach(i RANGE 0 ${last})
|
||||
string(APPEND joined "${ARGV${i}}")
|
||||
endforeach()
|
||||
message(DEPRECATION " IDF: ${joined}")
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
deprecate_variable(<var>)
|
||||
|
||||
*var[in]*
|
||||
|
||||
Deprecated variable name.
|
||||
|
||||
Print a warning about the use of a deprecated variable.
|
||||
#]]
|
||||
function(deprecate_variable var)
|
||||
if(${var})
|
||||
idf_deprecated("The use of the '${var}' variable is deprecated and will be ignored.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
__get_real_target(TARGET <target>
|
||||
OUTPUT <variable>)
|
||||
|
||||
Reference in New Issue
Block a user