]> granicus.if.org Git - esp-idf/commitdiff
tools: update make converter to use new component registration api
authorRenz Christian Bagaporo <renz@espressif.com>
Thu, 30 May 2019 06:17:10 +0000 (14:17 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Fri, 21 Jun 2019 11:53:29 +0000 (19:53 +0800)
tools/cmake/convert_to_cmake.py

index 80d9296d62c647925de21fc90f4b6831f3b3097c..0ba7fa62f54acb65d3b9ee63f8c88f436c6dd84a 100755 (executable)
@@ -161,17 +161,14 @@ def convert_component(project_path, component_path):
     cflags = v.get("CFLAGS", None)
 
     with open(cmakelists_path, "w") as f:
-        f.write("set(COMPONENT_ADD_INCLUDEDIRS %s)\n\n" % component_add_includedirs)
-
-        f.write("# Edit following two lines to set component requirements (see docs)\n")
-        f.write("set(COMPONENT_REQUIRES "")\n")
-        f.write("set(COMPONENT_PRIV_REQUIRES "")\n\n")
-
         if component_srcs is not None:
-            f.write("set(COMPONENT_SRCS %s)\n\n" % component_srcs)
-            f.write("register_component()\n")
+            f.write("idf_component_register(SRCS %s)\n" % component_srcs)
+            f.write("                       INCLUDE_DIRS %s" % component_add_includedirs)
+            f.write("                       # Edit following two lines to set component requirements (see docs)\n")
+            f.write("                       REQUIRES "")\n")
+            f.write("                       PRIV_REQUIRES "")\n\n")
         else:
-            f.write("register_config_only_component()\n")
+            f.write("idf_component_register()\n")
         if cflags is not None:
             f.write("target_compile_options(${COMPONENT_LIB} PRIVATE %s)\n" % cflags)