mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
09e50b27ed
COMPONENT_DIRS and EXTRA_COMPONENT_DIRS should be defined as CMake lists, using 'set' or 'list' commands. Some applications written for earlier versions of ESP-IDF used to define these variables as space separated strings. For example, the following is correct: set(EXTRA_COMPONENT_DIRS path/to/components path/to/more/components) The following is not correct: set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component1") set(EXTRA_COMPONENT_DIRS "${EXTRA_COMPONENT_DIRS} component2") The string "component1 component2" may indicate a single directory name with a space, or two directory names separated by space. However due to the fact that such way of defining EXTRA_COMPONENT_DIRS was supported in IDF 4.3 and earlier, we need to provide backward compatibility for it. This commit introduces a new script, split_paths_by_spaces.py, which is invoked if EXTRA_COMPONENT_DIRS or COMPONENT_DIRS variable contains spaces. The script tries to determine if each space should be interpreted as a separator or as part of the directory name. When this cannot be done unambiguously, the script reports an error. In all cases when space separators are detected, the script reports a warning, and prints instructions for fixing the CMakeLists.txt. Breaking change in this commit: specifying non-existent directories in COMPONENT_DIRS or EXTRA_COMPONENT_DIRS is no longer allowed.