fix handling of cc fragments

This commit is contained in:
Jason2866
2024-09-09 19:09:54 +02:00
committed by GitHub
parent 7f9a9c1d2a
commit 9edf55d724
+3 -3
View File
@@ -427,8 +427,8 @@ def get_app_flags(app_config, default_config):
for cg in config["compileGroups"]:
flags[cg["language"]] = []
for ccfragment in cg["compileCommandFragments"]:
fragment = ccfragment.get("fragment", "")
if not fragment.strip() or fragment.startswith("-D"):
fragment = ccfragment.get("fragment", "").strip("\" ")
if not fragment or fragment.startswith("-D"):
continue
flags[cg["language"]].extend(
click.parser.split_arg_string(fragment.strip())
@@ -713,7 +713,7 @@ def prepare_build_envs(config, default_env, debug_allowed=True):
build_env = default_env.Clone()
build_env.SetOption("implicit_cache", 1)
for cc in compile_commands:
build_flags = cc.get("fragment")
build_flags = cc.get("fragment", "").strip("\" ")
if not build_flags.startswith("-D"):
if build_flags.startswith("-include") and ".." in build_flags:
source_index = cg.get("sourceIndexes")[0]