midstar / pycstruct

A python library for reading and writing binary data similar to what is done in C language structs
MIT License
24 stars 4 forks source link

How to set include path? #36

Closed gianmarcoodorizzi closed 8 months ago

gianmarcoodorizzi commented 3 years ago

Hello, when parsing a complex project with multiple modules, I get many "fatal error: 'somefile/somefile.h' file not found" due to the fact that I am not able to specify include paths, the same way I am doing it with my makefile, e.g.:

`COMP_FLAGS :=-Isrc -Isrc/boards The issue here is that pycstruct is trying to find somefile/somefile.h under the CWD, while it would be great to let it search this header under src or src/boards folders.

Is there a way to achieve this? Is there a workaround?

Thank you.

midstar commented 3 years ago

Hi,

Check out the parameter castxml_extra_args that can be provided to parse_file. Here you can include all kinds of arguments to castxml (which includes clang compiler).

The castxml parameters are documented here;

https://manpages.debian.org/testing/castxml/castxml.1.en.html

BR, Joel

midstar commented 8 months ago

No change needed