Building a library only - no framework errors

Hi all!

I am building a library that has env:esp01 for target and env:native for the windows host. When I build for the target I want the library to build to a lib-name.a using platform:espressif8266 and board:esp01.

The problem is that I can’t get the system to compile to a library. If I add a framework then it will try to create an arduino build and therefore fails. If I don’t add a framework I get an error “AttributeError: ‘SConsEnvironment’ object has no attribute ‘ElfToBin’”.

I have a library.json file in the root directory

Any help would be appreciated!

my platformio.ini is below:

[env:esp01]
platform = espressif8266
board = esp01

[env:native]
platform = native
test_build_src = true
test_framework = doctest
build_flags = -std=c++23 -D DOCTEST_CONFIG_SUPER_FAST_ASSERTS
debug_test = test_tcp_server
lib_deps = doctest/doctest@^2.4.9

[platformio]
description = This is the code to create a library