summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2022-08-28 13:25:47 -0400
committerMan, Jianting (Meco) <[email protected]>2022-09-07 10:11:45 -0400
commitce16945cbab89543aa1e2674accfdbdd9fd8e686 (patch)
tree8da0ef2fa6ee44815b543aae3b7368415418b573 /tools
parentc75f52ff3a0b40a70a2eb2651b63241bb48c7428 (diff)
[kernel][version] 采用新的版本宏定义
版本控制规范:https://semver.org/ 目前的版本子号不是很规范,其中RT_VERSION甚至和VS那边造成了冲突 ```c /* RT-Thread version information */ #define RT_VERSION 4L /**< major version number */ #define RT_SUBVERSION 1L /**< minor version number */ #define RT_REVISION 1L /**< revise version number */ ``` 参考ESP32: ```c /** Major version number (X.x.x) */ #define ESP_ARDUINO_VERSION_MAJOR 2 /** Minor version number (x.X.x) */ #define ESP_ARDUINO_VERSION_MINOR 0 /** Patch version number (x.x.X) */ #define ESP_ARDUINO_VERSION_PATCH 3 ``` 建议改成: ```c /* Major version number (X.x.x) */ #define RT_VERSION_MAJOR 4 /* Minor version number (x.X.x) */ #define RT_VERSION_MINOR 2 /* Patch version number (x.x.X) */ #define RT_VERSION_PATCH 0 ```
Diffstat (limited to 'tools')
-rw-r--r--tools/building.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/building.py b/tools/building.py
index d518441151..d9fecd1567 100644
--- a/tools/building.py
+++ b/tools/building.py
@@ -968,11 +968,11 @@ def GetVersion():
prepcessor.process_contents(contents)
def_ns = prepcessor.cpp_namespace
- version = int([ch for ch in def_ns['RT_VERSION'] if ch in '0123456789.'])
- subversion = int([ch for ch in def_ns['RT_SUBVERSION'] if ch in '0123456789.'])
+ version = int([ch for ch in def_ns['RT_VERSION_MAJOR'] if ch in '0123456789.'])
+ subversion = int([ch for ch in def_ns['RT_VERSION_MINOR'] if ch in '0123456789.'])
- if 'RT_REVISION' in def_ns:
- revision = int([ch for ch in def_ns['RT_REVISION'] if ch in '0123456789.'])
+ if 'RT_VERSION_PATCH' in def_ns:
+ revision = int([ch for ch in def_ns['RT_VERSION_PATCH'] if ch in '0123456789.'])
return '%d.%d.%d' % (version, subversion, revision)
return '0.%d.%d' % (version, subversion)