Skip to content

Commit 9edf55d

Browse files
authored
fix handling of cc fragments
1 parent 7f9a9c1 commit 9edf55d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

builder/frameworks/espidf.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ def _extract_flags(config):
427427
for cg in config["compileGroups"]:
428428
flags[cg["language"]] = []
429429
for ccfragment in cg["compileCommandFragments"]:
430-
fragment = ccfragment.get("fragment", "")
431-
if not fragment.strip() or fragment.startswith("-D"):
430+
fragment = ccfragment.get("fragment", "").strip("\" ")
431+
if not fragment or fragment.startswith("-D"):
432432
continue
433433
flags[cg["language"]].extend(
434434
click.parser.split_arg_string(fragment.strip())
@@ -713,7 +713,7 @@ def prepare_build_envs(config, default_env, debug_allowed=True):
713713
build_env = default_env.Clone()
714714
build_env.SetOption("implicit_cache", 1)
715715
for cc in compile_commands:
716-
build_flags = cc.get("fragment")
716+
build_flags = cc.get("fragment", "").strip("\" ")
717717
if not build_flags.startswith("-D"):
718718
if build_flags.startswith("-include") and ".." in build_flags:
719719
source_index = cg.get("sourceIndexes")[0]

0 commit comments

Comments
 (0)