forked from zephyrproject-rtos/zephyr
-
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.
cmake: generalize VERSION infrastructure for better reuse
Generalize the VERSION and version.h generation so that the same infrastructure can be reused for generating other version related header files, such as an application version header. Signed-off-by: Torsten Rasmussen <[email protected]>
- Loading branch information
1 parent
37c6136
commit 2c757f9
Showing
4 changed files
with
97 additions
and
67 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
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 |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#ifndef _KERNEL_VERSION_H_ | ||
#define _KERNEL_VERSION_H_ | ||
#ifndef _@VERSION_TYPE@_VERSION_H_ | ||
#define _@VERSION_TYPE@_VERSION_H_ | ||
|
||
/* KERNEL and ZEPHYR_VERSION @templates@ values come from cmake/version.cmake | ||
* BUILD_VERSION @template@ will be 'git describe', alternatively user defined BUILD_VERSION. | ||
/* @templates@ values come from cmake/version.cmake | ||
* BUILD_VERSION related @template@ values will be 'git describe', | ||
* alternatively user defined BUILD_VERSION. | ||
*/ | ||
|
||
#cmakedefine ZEPHYR_VERSION_CODE @ZEPHYR_VERSION_CODE@ | ||
#define ZEPHYR_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
#cmakedefine ZEPHYR_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | ||
|
||
#define KERNELVERSION @KERNELVERSION@ | ||
#define KERNEL_VERSION_NUMBER @KERNEL_VERSION_NUMBER@ | ||
#define KERNEL_VERSION_MAJOR @KERNEL_VERSION_MAJOR@ | ||
#define KERNEL_VERSION_MINOR @KERNEL_VERSION_MINOR@ | ||
#define KERNEL_PATCHLEVEL @KERNEL_PATCHLEVEL@ | ||
#define KERNEL_VERSION_STRING @KERNEL_VERSION_STRING@ | ||
#define @VERSION_TYPE@VERSION @@VERSION_TYPE@VERSION@ | ||
#define @VERSION_TYPE@_VERSION_NUMBER @@VERSION_TYPE@_VERSION_NUMBER@ | ||
#define @VERSION_TYPE@_VERSION_MAJOR @@VERSION_TYPE@_VERSION_MAJOR@ | ||
#define @VERSION_TYPE@_VERSION_MINOR @@VERSION_TYPE@_VERSION_MINOR@ | ||
#define @VERSION_TYPE@_PATCHLEVEL @@VERSION_TYPE@_PATCHLEVEL@ | ||
#define @VERSION_TYPE@_VERSION_STRING "@@VERSION_TYPE@_VERSION_STRING@" | ||
|
||
#define BUILD_VERSION @BUILD_VERSION@ | ||
#define @BUILD_VERSION_NAME@ @@BUILD_VERSION_NAME@@ | ||
|
||
#endif /* _KERNEL_VERSION_H_ */ | ||
#endif /* _@VERSION_TYPE@_VERSION_H_ */ |