-
Notifications
You must be signed in to change notification settings - Fork 75
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
[API] Add getVersion function #2436
Conversation
📝 TAOS-CI Version: 1.5.20200925. Thank you for submitting PR #2436. Please a submit 1commit/1PR (one commit per one PR) policy to get comments quickly from reviewers. Your PR must pass all verificiation processes of cibot before starting a review process from reviewers. If you are new member to join this project, please read manuals in documentation folder and wiki page. In order to monitor a progress status of your PR in more detail, visit http://ci.nnstreamer.ai/. |
cibot: @SeoHyungjun, api/ccapi/include/common.h does not include Doxygen tags such as @file @brief @author @bug. You must include the Doxygen tags in the source code. Please refer to a Doxygen manual at http://github.com/nnstreamer/TAOS-CI/blob/main/ci/doc/doxygen-documentation.md |
cibot: @SeoHyungjun, The last line of a text file must have a newline character. Please append a new line at the end of the line in api/ccapi/meson.build. |
cb23412
to
1339332
Compare
cibot: @SeoHyungjun, The last line of a text file must have a newline character. Please append a new line at the end of the line in api/ccapi/meson.build. |
cibot: @SeoHyungjun, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nntrainer/ci/repo-workers/pr-checker/2436-202401291951130.077958106994629-13393324353a1201438a992451899b501201bb12/. |
5a98c25
to
0a3b24f
Compare
cibot: @SeoHyungjun, A builder checker could not be completed because one of the checkers is not completed. In order to find out a reason, please go to http://ci.nnstreamer.ai/nntrainer/ci/repo-workers/pr-checker/2436-202401291958470.78793692588806-0a3b24fb1a2fab046b76eccd465e92697e57b582/. |
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.
LGTM! except android build error
nntrainer_version_split = nntrainer_version.split('.') | ||
|
||
add_project_arguments('-DVERSION="' + nntrainer_version + '"', language: ['c', 'cpp']) | ||
add_project_arguments('-DVERSION_MAJOR=' + nntrainer_version_split[0], language: ['c', 'cpp']) |
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.
NNTRAINER_VERSION_MAJOR
or VERSION_MAJOR
?
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.
The version information is stored as an argument in meson.build in the root.
However, in api/ccapi/meson.build, we define variables to add to the header.
It appears that the values defined in meson.build in the root cannot be used when creating headers.
project arguments
- add_project_arguments('-DVERSION_MAJOR=' + nntrainer_version_split[0], language: ['c', 'cpp'])
Definition for creating header
- version_conf.set('NNTRAINER_VERSION_MAJOR', nntrainer_version_split[0])
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.
It appears that the values defined in meson.build in the root cannot be used when creating headers.
But,, project arguments are global var. please check scope
Project arguments
Project arguments work similar to global arguments except that they are valid only within the current subproject. The usage is simple:
add_project_arguments('-DMYPROJ=projname', language : 'c')
This would add the compiler flags to all C sources in the current project.
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.
Modified to use only one.
In the case of andoird, separate settings were required, so it was added.
LGTM! |
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.
LGTM
58d0f6a
to
61bdf1b
Compare
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.
@SeoHyungjun, 💯 All CI checkers are successfully verified. Thanks.
b1c252f
to
226d9ab
Compare
An API has been added to check the version of nntrainer through the project version of meson build. Available via ml::train::getVersion. issue : nnstreamer#2435 Signed-off-by: SeoHyungjun <[email protected]>
226d9ab
to
9c83f7a
Compare
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.
@SeoHyungjun, 💯 All CI checkers are successfully verified. Thanks.
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.
LGTM
std::string version = std::to_string(VERSION_MAJOR); | ||
version += "."; | ||
version += std::to_string(VERSION_MINOR); | ||
version += "."; | ||
version += std::to_string(VERSION_MICRO); | ||
|
||
return version; |
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.
std::string version = std::to_string(VERSION_MAJOR); | |
version += "."; | |
version += std::to_string(VERSION_MINOR); | |
version += "."; | |
version += std::to_string(VERSION_MICRO); | |
return version; | |
return std::to_string(VERSION_MAJOR) + "." + std::to_string(VERSION_MINOR) + "." + std::to_string(VERSION_MICRO); |
not a big deal, but a suggestion.
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.
Good PR!
An API has been added to check the version of nntrainer through the project version of meson build.
Available via ml::train::getVersion.
issue : #2435
Signed-off-by: SeoHyungjun [email protected]