Skip to content

Commit 7676a2f

Browse files
committed
load_usermods debug
1 parent 32607ee commit 7676a2f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

pio-scripts/load_usermods.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,27 @@ def find_usermod(mod: str):
3737
# Save the old value
3838
cpl = env.ConfigureProjectLibBuilder
3939
# Our new wrapper
40-
def cpl_wrapper(env):
41-
# Update usermod properties
42-
lib_builders = env.GetLibBuilders()
40+
def cpl_wrapper(xenv):
41+
# Update usermod properties
42+
lib_builders = xenv.GetLibBuilders()
43+
wled_dir = xenv["PROJECT_SRC_DIR"]
4344
um_deps = [dep for dep in lib_builders if usermod_dir in Path(dep.src_dir).parents]
4445
other_deps = [dep for dep in lib_builders if usermod_dir not in Path(dep.src_dir).parents]
46+
print(xenv.Dump())
4547
for um in um_deps:
4648
# Add include paths for all non-usermod dependencies
4749
for dep in other_deps:
4850
for dir in dep.get_include_dirs():
4951
um.env.PrependUnique(CPPPATH=dir)
50-
# Add the wled folder to the include path
51-
um.env.PrependUnique(CPPPATH=env["PROJECT_SRC_DIR"])
52+
# Add the wled folder to the include path
53+
print(f"{str(um)}: adding {wled_dir}")
54+
um.env.PrependUnique(CPPPATH=wled_dir)
5255
# Make sure we link directly, not through an archive
5356
# Archives drop the .dtor table section we need
5457
build = um._manifest.get("build", {})
5558
build["libArchive"] = False
5659
um._manifest["build"] = build
57-
return cpl.clone(env)()
60+
return cpl.clone(xenv)()
5861

5962

6063
# Replace the old one with ours

0 commit comments

Comments
 (0)