ncnn
ncnn copied to clipboard
NCNN_VERSION_STRING enhancement
Problem description
The c/c++ macro NCNN_VERSION_STRING describes the build date, and maybe change it to "source code tag / commit" is better.
Details
In the CMakeLists.txt, there is NCNN_VERSION_STRING defined.
The header file platform.h, which is generated from platform.h.in, defines NCNN_VERSION_STRING macro, which is generated from the cmake variable NCNN_VERSION_STRING.
Today( 2022.08.04), I cloned and switched to tag 20220701, build and install then use it, but get the version "20220804", feel confusing..
#include "platform.h"
#include "c_api.h"
int main()
{
fprintf(stderr, "version: %s\n", NCNN_VERSION_STRING);
fprintf(stderr, "ncnn_version: %s\n", ncnn_version());
return 0;
}
Actual Output:
version: 1.0.20220804
ncnn_version: 1.0.20220804
Expected Output:
version: 1.0.202200701
ncnn_version: 1.0.20220701
Or
version: 1.0.202200701-BuildDate20220804
ncnn_version: 1.0.20220701-BuildDate20220804