I added a library to platformio.ini : lib_deps = mbed-http
Great so it downloaded the dependency, with the structure:
http_parser
– http_parser.c
– http_parser.h
source
– http_request.h
– http_request_builder.h
etc…
(I think http_parser is a dependency of mbed-http )
If I want to include the library in my project, I need to use fully qualified paths :
#include <source/http_request.h>
#include <http_parser/http_parser.h>
But I also need to go into the library and change the internal library dependencies, so in http_request.h :
#include "http_parser.h" // Doesn't work
#include "http_parser/http_parser.h" // Works
Really the paths are not targeted correctly and the libraries are not portable.
Is this a PIO problem or a problem with this particular library ?
Interesting how mbed-os builds libraries then. The mbed_lib.json
doesn’t explicitly declare any include directories. Seems to automagically include all paths in a library then?
Anyways, bug report in GitHub - platformio/builder-framework-mbed: ARM mbed build script for PlatformIO Build System please because I think that just including the library folder as -I
path is not what mbed-os does.
return "debug"
else:
return "develop"
def _file_long_data(env, data):
tmp_file = os.path.join(
"$BUILD_DIR", "longinc-%s" % hashlib.md5(hashlib_encode_data(data)).hexdigest()
)
build_dir = env.subst("$BUILD_DIR")
if not os.path.isdir(build_dir):
os.makedirs(build_dir)
if os.path.isfile(env.subst(tmp_file)):
return tmp_file
with open(env.subst(tmp_file), "w") as fp:
fp.write(data)
return tmp_file
def long_incflags_hook(incflags):
return '@"%s"' % _file_long_data(
CC @valeros