Skip to content

Commit 521c048

Browse files
committed
Properly handle debug mode for custom libraries
Resolve #520
1 parent 72d75e6 commit 521c048

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

builder/frameworks/stm32cube.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,10 @@
4949

5050
class CustomLibBuilder(PlatformIOLibBuilder):
5151

52-
PARSE_SRC_BY_H_NAME = False
53-
54-
# Max depth of nested includes:
55-
# -1 = unlimited
56-
# 0 - disabled nesting
57-
# >0 - number of allowed nested includes
58-
CCONDITIONAL_SCANNER_DEPTH = 0
59-
60-
# For cases when sources located not only in "src" dir
61-
@property
62-
def src_dir(self):
63-
return self.path
52+
def build(self):
53+
if self.env.GetBuildType() == "debug":
54+
self.env.ConfigureDebugFlags()
55+
return PlatformIOLibBuilder.build(self)
6456

6557

6658
def generate_ldscript(default_ldscript_path):
@@ -151,7 +143,7 @@ def build_custom_lib(lib_path, lib_manifest=None):
151143
lib_manifest = lib_manifest or {"name": os.path.basename(lib_path)}
152144
env.Append(
153145
EXTRA_LIB_BUILDERS=[
154-
PlatformIOLibBuilder(env, lib_path, lib_manifest.copy())
146+
CustomLibBuilder(env, lib_path, lib_manifest.copy())
155147
]
156148
)
157149

0 commit comments

Comments
 (0)