INNER CODE UNIT · Python
gen_sbom_supports
wolfSSL/wolfBoot · tools/sbom/sbom-driver.py:115
def gen_sbom_supports(python, gen_sbom, flag):
"""Return True if the generator advertises a flag in its --help."""
try:
res = subprocess.run([python, gen_sbom, "--help"],
capture_output=True, text=True, check=False)
except OSError:
return False
return flag in (res.stdout + res.stderr)
def split_cflags(cflags):
"""Split a CFLAGS string on whitespace.
Deliberately a plain split rather than shlex: --cflags arrives from a Make
recipe, so the shell has already removed one layer of quoting. Re-lexing it
as shell words would strip a second layer, and shlex's POSIX escape
handling would eat the backslashes out of Windows paths --
-DPICO_SDK_PATH=C:\\Users\\ci\\sdk becomes C:Userscisdk, which is both