-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
cmake: version.h generation performed at build time #42527
Merged
nashif
merged 1 commit into
zephyrproject-rtos:main
from
tejlmand:issues/40167_build_version
Feb 8, 2022
Merged
cmake: version.h generation performed at build time #42527
nashif
merged 1 commit into
zephyrproject-rtos:main
from
tejlmand:issues/40167_build_version
Feb 8, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SebastianBoe
reviewed
Feb 7, 2022
SebastianBoe
reviewed
Feb 7, 2022
SebastianBoe
requested changes
Feb 7, 2022
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.
changes requested
tejlmand
force-pushed
the
issues/40167_build_version
branch
from
February 7, 2022 12:33
2c7c4a2
to
f96c204
Compare
SebastianBoe
reviewed
Feb 7, 2022
tejlmand
force-pushed
the
issues/40167_build_version
branch
2 times, most recently
from
February 7, 2022 20:15
70573c8
to
35b4092
Compare
SebastianBoe
reviewed
Feb 8, 2022
SebastianBoe
reviewed
Feb 8, 2022
SebastianBoe
approved these changes
Feb 8, 2022
tejlmand
force-pushed
the
issues/40167_build_version
branch
from
February 8, 2022 09:10
35b4092
to
c96156a
Compare
Fixes: zephyrproject-rtos#39503 Fixes: zephyrproject-rtos#40167 This commit moves `BUILD_VERSION` CMake variable from a compile definition to be a define inside version.h. Besides the benefit of having related settings grouped in a common header, it also means that an updated `BUILD_VERSION` value does not need to trigger re-compilation of all source files. When using compile definitions, CMake cannot tell whether a given source files uses the definition or not, and hence all sources must be recompiled to be sure they are up-to-date. Placing `BUILD_VERSION` in version.h, the source dependencies ensures that only source files including `version.h` gets recompiled. As part of this, version.h generation is moved so that it is now done at build time. This means that re-generation of version.h is no longer depending on a CMake re-run but can have it's own dependency in `.git/index` when git described is used to obtain `BUILD_VERSION` information. Generation of logging dictionary database has been updated to support BUILD_VERSION from header file instead of CMake configure time variable. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
tejlmand
force-pushed
the
issues/40167_build_version
branch
from
February 8, 2022 09:19
c96156a
to
fd265d0
Compare
nashif
approved these changes
Feb 8, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #39503
Fixes: #40167
This commit moves
BUILD_VERSION
CMake variable from a compiledefinition to be a define inside version.h.
Besides the benefit of having related settings grouped in a common
header, it also means that an updated
BUILD_VERSION
value does notneed to trigger re-compilation of all source files.
When using compile definitions, CMake cannot tell whether a given source
files uses the definition or not, and hence all sources must be
recompiled to be sure they are up-to-date.
Placing
BUILD_VERSION
in version.h, the source dependencies ensuresthat only source files including
version.h
gets recompiled.As part of this, version.h generation is moved so that it is now done
at build time.
This means that re-generation of version.h is no longer depending on a
CMake re-run but can have it's own dependency in
.git/index
when gitdescribed is used to obtain
BUILD_VERSION
information.Signed-off-by: Torsten Rasmussen Torsten.Rasmussen@nordicsemi.no