How to build a subproject which depends on user provided header files? #11809
-
I am trying to build the STM32CubeF4 libraries to program ST Micro-controllers. They provide everything as a github repository so I have forked it and added a Some of the files/libraries, specifically the HAL component, require the user to copy a template header, rename it and use it to build the library. This is making it very hard to actually use this as a subproject, since the library files depend on a file outside the subproject (a user provided file) and I can't use said file because it violates the sandbox. Any ideas how to overcome this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Does it have to be physically present in the subproject or is adding the header as an include_directories to the same target that also tries to depend on the subproject, work? In the former case you could try adding the header file path as a subproject option, and copy it over via a super hacky run_command. It won't automatically update though. Can the header be generated using options or does it require fully custom implementation? If it's just a matter of setting configuration defines I'd just add a bunch of options to toggle each setting. |
Beta Was this translation helpful? Give feedback.
Does it have to be physically present in the subproject or is adding the header as an include_directories to the same target that also tries to depend on the subproject, work?
In the former case you could try adding the header file path as a subproject option, and copy it over via a super hacky run_command. It won't automatically update though.
Can the header be generated using options or does it require fully custom implementation? If it's just a matter of setting configuration defines I'd just add a bunch of options to toggle each setting.