Detecting framework at build time

Is there any way to determine which framework is being used during compile?

As an example, I have a project that I’d like to build 3 different ways.
framework = esp8266-rtos-sdk
framework = esp8266-nonos-sdk
and
framework = arduino

Now, the first 2 are fairly compatible with each other. But, the 3rd is vastly different.

I’d like to be able to do something along the lines of:

#ifdef arduino
Serial.println("This is something odd");
#endif
#ifdef esp8266-rtos-sdk
printf("This is something odd");
#endif

& so on…

So far, the only solution I’ve come up with is to actually put a build_flags entry in each build environment. This seems kind of redundant to me.

Well, I’d go with a macro definition, I don’t think that PIO injects env/framework value by itself:

build_flags =
   '-D FRAMEWORK="whatever value you want"'

Pretty close to what I’m currently doing…
Still seems clunky.

But yes, as a macro is a little bit better…