Import("env")


env.Append(
    CPPPATH=[
        "#/",
        "#/lib",
        # Ugly hack
        Dir("../assets/compiled"),
        # subghz and nfc are no longer built as firmware modules (their
        # SConscripts don't run), but their headers must still be resolvable —
        # both by the firmware core (furi_hal_subghz/nfc) and by external apps
        # that carry these libs privately and use root-relative includes like
        # "protocols/mf_classic/mf_classic.h". Expose their roots on CPPPATH.
        "#/lib/subghz",
        "#/lib/nfc",
        "#/lib/lfrfid",
    ],
    SDK_HEADERS=[
        File("../applications/services/applications.h"),
    ],
)


libs = env.BuildModules(
    [
        "mlib",
        "stm32wb",
        "freertos",
        "print",
        "microtar",
        "mbedtls",
        "toolbox",
        "libusb_stm32",
        "drivers",
        "fatfs",
        "flipper_format",
        "infrared",
        # subghz, nfc and lfrfid are NOT linked into the firmware. They ship as
        # self-contained external apps that each carry their own private copy of
        # the library (executed via XIP). This frees internal flash so subghz/nfc
        # can enable their full protocol catalogs and leaves headroom for future
        # protocols. furi_hal_subghz / furi_hal_nfc stay in the firmware and are
        # used by those apps via the SDK.
        "digital_signal",
        "pulse_reader",
        "signal_reader",
        "u8g2",
        "flipper_application",
        "music_worker",
        "nanopb",
        "update_util",
        "heatshrink",
        "ble_profile",
        "bit_lib",
        "datetime",
        "ieee754_parse_wrap",
    ],
)

Return("libs")
