From 1f22745e05aec613e3cbac5580105da022fa5e67 Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Sun, 2 Mar 2025 12:58:16 +0000 Subject: [PATCH] Add support for relative include --- codegen/datatypes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codegen/datatypes.py b/codegen/datatypes.py index 9dbbcfd..51b1a76 100644 --- a/codegen/datatypes.py +++ b/codegen/datatypes.py @@ -169,6 +169,7 @@ class CFunc: class CInclude: header: Union[str, "CHeader"] local: bool = False + same_dir: bool = False def __str__(self) -> str: if isinstance(self.header, CHeader): @@ -179,6 +180,9 @@ class CInclude: if self.local: open_symbol = '"' close_symbol = '"' + + if self.same_dir: + name = f"./{name}" else: open_symbol = '<' close_symbol = '>'