From 250e219279fd84c71909eb561b78ca0bb267b8d1 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Fri, 20 Dec 2019 10:19:54 +1100 Subject: [PATCH] cmake: convert_to_cmake: Fix possible whitespace issues As reported on forum: https://esp32.com/viewtopic.php?f=2&t=13565&p=53476#p53453 split() with no arg will match any whitespace sequence not just a single space, so takes care of case where two spaces are inserted in the variable value. --- tools/cmake/convert_to_cmake.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cmake/convert_to_cmake.py b/tools/cmake/convert_to_cmake.py index 0ba7fa62f..2ac147006 100755 --- a/tools/cmake/convert_to_cmake.py +++ b/tools/cmake/convert_to_cmake.py @@ -78,14 +78,14 @@ def get_component_variables(project_path, component_path): return None srcs = [] - for obj in make_vars["COMPONENT_OBJS"].split(" "): + for obj in make_vars["COMPONENT_OBJS"].split(): src = find_src(obj) if src is not None: srcs.append(src) make_vars["COMPONENT_SRCS"] = " ".join(srcs) else: component_srcs = list() - for component_srcdir in make_vars.get("COMPONENT_SRCDIRS", ".").split(" "): + for component_srcdir in make_vars.get("COMPONENT_SRCDIRS", ".").split(): component_srcdir_path = os.path.abspath(os.path.join(component_path, component_srcdir)) srcs = list() @@ -114,7 +114,7 @@ def convert_project(project_path): if "PROJECT_NAME" not in project_vars: raise RuntimeError("PROJECT_NAME does not appear to be defined in IDF project Makefile at %s" % project_path) - component_paths = project_vars["COMPONENT_PATHS"].split(" ") + component_paths = project_vars["COMPONENT_PATHS"].split() # Convert components as needed for p in component_paths: