fix handling of cc fragments

This commit is contained in:
Jason2866
2024-09-09 18:45:59 +02:00
committed by GitHub
parent 2642ed8da7
commit 52fc97538f
+3 -3
View File
@@ -429,8 +429,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())
@@ -715,7 +715,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]