-
Notifications
You must be signed in to change notification settings - Fork 8.2k
RFC: include version.h in the build system
#60651
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -119,3 +119,5 @@ foreach(type file IN ZIP_LISTS VERSION_TYPE VERSION_FILE) | |||||||||||||||||
| unset(PATCH) | ||||||||||||||||||
| unset(${type}_VERSION_WITHOUT_TWEAK) | ||||||||||||||||||
| endforeach() | ||||||||||||||||||
|
|
||||||||||||||||||
| set(VERSION_H ${PROJECT_BINARY_DIR}/include/generated/version.h) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not the right location for this piece of information. This file is used for CMake and is used both for Zephyr's kernel version, Application version, but can also be used by downstream users. The intention of this CMake code is to parse a The Notice also that this call: Lines 558 to 563 in 657462d
with your proposal both feeds in VERSION_H as the OUT_FILE argument, but that the script gen_version_h.cmake actually calls on to version.cmake where you just made that piece on info directly available.
zephyr/cmake/gen_version_h.cmake Line 32 in 9e8d609
Suggested change
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK with change except for this, should remain an include file which users #include if they need it. Having it in kernel.h I am undecided upon as it seems likely that some codebase or library somewhere will have a conflicting define
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is the essence of the second way. Do you think name spacing the macros in the
version.h(i.e.ZEPHYR_*) would help with mitigating the potential conflict?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this.
Code should include what it needs, so if the code requires
version.h, then it should includeversion.h.I don't see why
version.his more special thankernel.h,errno.h, orstring.hwhich are includes you find almost everywhere.