I am currently trying to build Amazon’s FreeRTOS platform with PlatformIO (GitHub - aws/amazon-freertos: DEPRECATED - See README.md). I currently have their git repo downloaded to my project directory and what I’d like to do is include all the relevant directories from the repo without changing the repo file structure so that as the repo is updated, the new code can just work.
The problem is that the amazon-freertos repo isn’t structured like a bunch of libraries but just has folders that need to be searched for header files. I tried specifying these folders with -Iamazon-freertos/lib/… -Iamazon-freertos/lib/… which got the code to compile but the linker didn’t seem to link the compiled .o files together.
Is there a way to do what I’m trying to do with PlatformIO? I hope this all made sense. Thanks!
Clone this repo to lib
folder and add library.json
. in this manifest you can control the build logic of this library. See Redirecting...
@crowecawcaw did you ever get this working? If so, would you mind sharing your setup? Thank you.
Hi @ivankravets ,
I’m trying to do a similar thing to what @crowecawcaw is doing, but how to include different folders inside a library?
One common library found in these demos is coreMQTT, which has the following structure:
coreMQTT
--->source
--->core_mqtt.c
--->core_mqtt_serializer.c
--->core_mqtt_state.c
--->include (folder)
--->core_mqtt.h
--->soon_and_soforth.h
--->interface (folder)
--->transport_interface.h
How can I make a library.json file to include this library in the build process?
Thanks!
The flags
sub-attribute of the build
attribute can be an array, so you can include multiple folders by using multiple -I
switches.
{
//all other stuff..
"build": {
"srcDir": "source",
"flags": [
"-Isource/include",
"-Isource/interface"
]
}
}
if you have problems please post a new topic with the current state of your library.json
and a minimal project / code.
2 Likes