mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
feat(cmakev2): introduce __idf_component_get_property_unchecked helper
Retrieve the value of the specified component property quickly. The existing `idf_component_get_property` function performs various checks to identify the component interface target, which keeps the component properties, and accepts a component name, target, target alias, or interface. While `idf_component_get_property` uses a cache to identify the component interface relatively quickly, it is still much slower compared to the raw `get_property`. The `__idf_component_get_property_unchecked` function provides a faster way how to obtain component property if the component interface is already known. It skips all the checks, so it must be used carefully. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -54,6 +54,40 @@ function(idf_component_set_property component property value)
|
||||
${append})
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
.. cmakev2:function:: __idf_component_get_property_unchecked
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
__idf_component_get_property_unchecked(<variable> <component_interface> <property>)
|
||||
|
||||
*variable[out]*
|
||||
|
||||
Variable to store the value in.
|
||||
|
||||
*component_interface[in]*
|
||||
|
||||
Component interface target.
|
||||
|
||||
*property[in]*
|
||||
|
||||
Property name to get the value of.
|
||||
|
||||
Retrieve the value of the specified component property quickly. The
|
||||
``idf_component_get_property`` function performs various checks to identify
|
||||
the component interface target, which keeps the component properties and
|
||||
accepts a component name, target, target alias, or interface. While
|
||||
``idf_component_get_property`` uses a cache to identify the component
|
||||
interface relatively quickly, it is still much slower compared to the raw
|
||||
``get_property``. This function should only be used if the component
|
||||
interface is already known. It skips all the checks, so it must be used
|
||||
carefully.
|
||||
#]]
|
||||
function(__idf_component_get_property_unchecked variable component_interface property)
|
||||
get_property(value TARGET ${component_interface} PROPERTY ${property})
|
||||
set(${variable} ${value} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
#[[api
|
||||
.. cmakev2:function:: idf_component_get_property
|
||||
|
||||
|
||||
Reference in New Issue
Block a user