INNER CODE UNIT · Python

split_cflags

wolfSSL/wolfBoot · tools/sbom/sbom-driver.py:125

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
    wrong and no longer matched by the absolute-path scrub, so a mangled host
    path would leak into the SBOM.
    """
    return cflags.split()


def capture_macros(hostcc, cflags, settings_h="", include_dirs=()):
    """Expand a build configuration through the host compiler's -dM -E.

    The capture must see BOTH inputs that determine the configuration:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…