PlatformIO Community

Is second-level inheritance possible?

[env] seems to be inherited by [env:A], [env:B], etc. But, is it possible to inherit [env:A]?

For example,

platform = espressif8266
framework = arduino
lib_dep = someLinbrary
lib_extra_dirs = some directory

board = esp01_1m

build_type = debug


board = nodemcuv2

build_type = debug


Yes, through extends, arbitrary-depth inheritence is possible.

Though you should only be using the name scheme env:name name not env:name1:name2.

A project that uses such a structure is e.g. Marlin.

platform         = ststm32@~12.1
board_build.core = stm32


extends       = common_stm32
extra_scripts = ${common_stm32.extra_scripts}


extends              = stm32_variant
board                = genericSTM32F103RC


platform                    = ${common_stm32.platform}
extends                     = common_STM32F103RC_variant
build_flags                 = ${common_STM32F103RC_variant.build_flags}