forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version: creating ncs_version.h with input from VERSION.
This commit generates a ncs_version.h which can be included in source code. version.h is generated from version.h.in with data from VERSION. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
- Loading branch information
Showing
5 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
math(EXPR NCS_VERSION_CODE "(${NCS_VERSION_MAJOR} << 16) + (${NCS_VERSION_MINOR} << 8) + (${NCS_VERSION_PATCH})") | ||
|
||
# to_hex is made available by ${ZEPHYR_BASE}/cmake/hex.cmake | ||
to_hex(${NCS_VERSION_CODE} NCS_VERSION_NUMBER) | ||
|
||
configure_file(${NRF_DIR}/ncs_version.h.in ${ZEPHYR_BINARY_DIR}/include/generated/ncs_version.h) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _NCS_VERSION_H_ | ||
#define _NCS_VERSION_H_ | ||
|
||
#cmakedefine NCS_VERSION_CODE @NCS_VERSION_CODE@ | ||
#define NCS_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
|
||
#define NCS_VERSION_NUMBER @NCS_VERSION_NUMBER@ | ||
#define NCS_VERSION_MAJOR @NCS_VERSION_MAJOR@ | ||
#define NCS_VERSION_MINOR @NCS_VERSION_MINOR@ | ||
#define NCS_PATCHLEVEL @NCS_VERSION_PATCH@ | ||
#define NCS_VERSION_STRING "@NCS_VERSION@" | ||
|
||
#endif /* _NCS_VERSION_H_ */ |
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