瀏覽代碼

lib_build: exclude file from example

Florent 11 月之前
父節點
當前提交
df18dfb481
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      build_as_lib.py

+ 5 - 0
build_as_lib.py

@@ -58,6 +58,11 @@ for item in menv.get("CPPDEFINES", []):
         example_name = item[1]
         src_filter.append(f"+<../examples/{example_name}>")
 
+    # EXCLUDE A SOURCE FILE FROM AN EXAMPLE (must be placed after example name or boom)
+    elif isinstance(item, tuple) and item[0] == "EXCLUDE_FROM_EXAMPLE":
+        exclude_name = item[1]
+        src_filter.append(f"-<../examples/{example_name}/{exclude_name}>")
+
 menv.Replace(SRC_FILTER=src_filter)
 
 #print (menv.Dump())