Problem
After #1097 changes framework library selection to seed only from sketch translation units, FastLED Teensy Blink no longer selects Audio, SD, SdFat, or SerialFlash. However fbuild lib-select --explain still selects DmxSimple, OctoWS2811, and SoftwareSerial because fbuild-header-scan deliberately traverses both sides of every conditional.
Examples in reachable FastLED headers:
#ifdef USE_OCTOWS2811 ? <OctoWS2811.h>
#ifdef DmxSimple_h ? <DmxSimple.h>
#if defined(ARDUINO) && defined(SoftwareSerial_h) ? <SoftwareSerial.h>
Those macros are not enabled by Blink, so the headers are not in the compiler's active include graph.
Required behavior
Library selection must follow the active include graph for the target build:
- Start from sketch translation units.
- Seed preprocessor state from the target's compile defines and sketch-local defines.
- Evaluate
#if, #ifdef, #ifndef, #elif, #else, and #endif sufficiently to skip inactive #includes.
- Preserve selection when a sketch explicitly defines the relevant feature macro or includes the feature header directly.
- Incorporate the define set / conditional mode into the library-selection cache key.
Acceptance
- FastLED Teensy 4.1 Blink selects only framework libraries in its active graph.
- Blink does not select DmxSimple, OctoWS2811, SoftwareSerial, Audio, SD, SdFat, or SerialFlash unless the sketch enables/includes that feature.
- Existing direct and transitive library-selection tests remain valid.
- Add unit coverage for
#if 0, inactive #ifdef, enabled sketch macro, and target compile defines.
Parent: #1094. Consumer: FastLED/FastLED#3696.
Problem
After #1097 changes framework library selection to seed only from sketch translation units, FastLED Teensy Blink no longer selects Audio, SD, SdFat, or SerialFlash. However
fbuild lib-select --explainstill selectsDmxSimple,OctoWS2811, andSoftwareSerialbecausefbuild-header-scandeliberately traverses both sides of every conditional.Examples in reachable FastLED headers:
#ifdef USE_OCTOWS2811?<OctoWS2811.h>#ifdef DmxSimple_h?<DmxSimple.h>#if defined(ARDUINO) && defined(SoftwareSerial_h)?<SoftwareSerial.h>Those macros are not enabled by Blink, so the headers are not in the compiler's active include graph.
Required behavior
Library selection must follow the active include graph for the target build:
#if,#ifdef,#ifndef,#elif,#else, and#endifsufficiently to skip inactive#includes.Acceptance
#if 0, inactive#ifdef, enabled sketch macro, and target compile defines.Parent: #1094. Consumer: FastLED/FastLED#3696.