Skip to contentSkip to conversation

Best practice to share constants between C code and recipes

DISCUSSION [email protected] 2 participants 2 messages May 18, 2024

lore
Share & tools
lore
#0 lore raw

Hello,

A project uses GUIDs. They are constant string values. The values are used:
- in several recipes do_install() function to generate xml files
- in another recipe where the GUIDs are used in C code

What is the best practice to manage these constants so they are centralized in a single file? Is it OK to put them in a bitbake .inc file, then generate a C header file at build time? Are dependencies managed correctly in that case? Changing the .inc file should trigger rebuilding of the C code.

Thanks in advance for any suggestions
Best regards

#1 lore raw
Quoted 10 lines · On Fri, May 17, 2024 at 5:55 PM maude007 via lists.yoctoproject.org…

Hello,

A project uses GUIDs. They are constant string values. The values are used:
- in several recipes do_install() function to generate xml files
- in another recipe where the GUIDs are used in C code

What is the best practice to manage these constants so they are centralized in a single file? Is it OK to put them in a bitbake .inc file, then generate a C header file at build time? Are dependencies managed correctly in that case? Changing the .inc file should trigger rebuilding of the C code.

Thanks in advance for any suggestions

you might want to look into useradd-staticids class -
https://docs.yoctoproject.org/ref-manual/classes.html?highlight=useradd+staticids#ref-classes-useradd

Quoted 9 lines

Best regards
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13356): https://lists.yoctoproject.org/g/poky/message/13356
Mute This Topic: https://lists.yoctoproject.org/mt/106165043/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-