Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Generated header include relative path instead of component id #22

Open
wants to merge 1 commit into
base: stable
Choose a base branch
from

Conversation

keyboard-slayer
Copy link
Member

@keyboard-slayer keyboard-slayer commented Jul 7, 2024

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 keyboard-slayer marked this pull request as draft July 7, 2024 23:39
@keyboard-slayer keyboard-slayer changed the title fix: Generated header include relative path instead of component id [WIP] fix: Generated header include relative path instead of component id Jul 7, 2024
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"
@keyboard-slayer keyboard-slayer changed the title [WIP] fix: Generated header include relative path instead of component id fix: Generated header include relative path instead of component id Jul 7, 2024
@keyboard-slayer keyboard-slayer marked this pull request as ready for review July 7, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant