Skip to content

Commit 2ad4e1d

Browse files
authored
fix handling of cc fragments
1 parent 919bd1e commit 2ad4e1d

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
@@ -429,8 +429,8 @@ def _extract_flags(config):
429429
for cg in config["compileGroups"]:
430430
flags[cg["language"]] = []
431431
for ccfragment in cg["compileCommandFragments"]:
432-
fragment = ccfragment.get("fragment", "")
433-
if not fragment.strip() or fragment.startswith("-D"):
432+
fragment = ccfragment.get("fragment", "").strip("\" ")
433+
if not fragment or fragment.startswith("-D"):
434434
continue
435435
flags[cg["language"]].extend(
436436
click.parser.split_arg_string(fragment.strip())
@@ -715,7 +715,7 @@ def prepare_build_envs(config, default_env, debug_allowed=True):
715715
build_env = default_env.Clone()
716716
build_env.SetOption("implicit_cache", 1)
717717
for cc in compile_commands:
718-
build_flags = cc.get("fragment")
718+
build_flags = cc.get("fragment", "").strip("\" ")
719719
if not build_flags.startswith("-D"):
720720
if build_flags.startswith("-include") and ".." in build_flags:
721721
source_index = cg.get("sourceIndexes")[0]

0 commit comments

Comments
 (0)