cutekit icon indicating copy to clipboard operation
cutekit copied to clipboard

fix: Generated header include relative path instead of component id

Open keyboard-slayer opened this issue 1 year ago • 0 comments

Description of the issue

Let's imagine the following component structure

software/
├─ manifest.json -> A binary with id "software.cli" 
├─ lib/
│  ├─ manifest.json -> A lib with id "software"
│  ├─ mod.h

Afterwards we would like to include the lib like so:

#include <software>

But the alias generator will create a header file with the following content:

#include <software/mod.h>

But as shown by the tree above, the mod file isn't in the "software" directory

The fix

Since the compilation is ran at the root of the project, we can simply do a relative include like this:

#include "../../../src/software/lib/mod.h"

The relative path is not hardcoded and is calculated by Python.

keyboard-slayer avatar Jul 07 '24 23:07 keyboard-slayer