CMake: detect uclibc and musl version

This commit is contained in:
李通洲
2023-10-08 21:03:10 +08:00
parent 2e60f34cd8
commit fa46dce0e1
2 changed files with 18 additions and 2 deletions
+9 -2
View File
@@ -7,12 +7,19 @@
const char* ffDetectLibc(FFLibcResult* result)
{
#ifdef __GNU_LIBRARY__
#ifdef __UCLIBC__
result->name = "uClibc";
result->version = FF_STR(__UCLIBC_MAJOR__) "." FF_STR(__UCLIBC_MINOR__) "." FF_STR(__UCLIBC_SUBLEVEL__);
#elif defined(__GNU_LIBRARY__)
result->name = "glibc";
result->version = FF_STR(__GLIBC__) "." FF_STR(__GLIBC_MINOR__);
#else
result->name = "musl";
result->version = NULL;
#ifdef FF_MUSL_VERSION
result->version = FF_MUSL_VERSION;
#else
result->version = NULL;
#endif
#endif
return NULL;