MCPcopy Create free account
hub / github.com/FastLED/FastLED / get_lib_compile_flags_dict

Function get_lib_compile_flags_dict

ci/wasm_flags.py:81–111  ·  view source on GitHub ↗

Get library compilation flags as a dict. Combines [all] + [library] + [build_modes. ]. If library_flags exists in build mode, it replaces both [library].compiler_flags and [build_modes].flags (allows per-mode library flag overrides, e.g. no LTO). Returns: {"define

(mode: str = "quick")

Source from the content-addressed store, hash-verified

79
80
81def get_lib_compile_flags_dict(mode: str = "quick") -> dict[str, list[str]]:
82 """
83 Get library compilation flags as a dict.
84
85 Combines [all] + [library] + [build_modes.<mode>].
86 If library_flags exists in build mode, it replaces both [library].compiler_flags
87 and [build_modes].flags (allows per-mode library flag overrides, e.g. no LTO).
88
89 Returns:
90 {"defines": [...], "compiler_flags": [...]}
91 """
92 config = _load_toml()
93
94 defines = list(config.get("all", {}).get("defines", []))
95 compiler_flags = list(config.get("all", {}).get("compiler_flags", []))
96
97 defines.extend(config.get("library", {}).get("defines", []))
98
99 build_mode_config = config.get("build_modes", {}).get(mode, {})
100 # Use library-specific flags if available, otherwise fall back to
101 # [library].compiler_flags + build mode flags
102 library_mode_flags = build_mode_config.get("library_flags")
103 if library_mode_flags is not None:
104 compiler_flags.extend(library_mode_flags)
105 else:
106 compiler_flags.extend(config.get("library", {}).get("compiler_flags", []))
107 compiler_flags.extend(build_mode_config.get("flags", []))
108
109 compiler_flags.extend(_lib_dwarf_prefix_map_flags(config, mode))
110
111 return {"defines": defines, "compiler_flags": compiler_flags}
112
113
114def get_sketch_compile_flags_dict(mode: str = "quick") -> dict[str, list[str]]:

Callers 4

mainFunction · 0.90
build_libraryFunction · 0.90
load_build_flagsMethod · 0.90
get_lib_compile_flagsFunction · 0.85

Calls 4

_load_tomlFunction · 0.85
listClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected