From 43b96df1121758a32b82a8e6de7dc6524dc1425e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 2 Apr 2024 14:28:25 +0800 Subject: [PATCH] Version: detect apple clang --- src/detection/version/version.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/detection/version/version.c b/src/detection/version/version.c index 202c10ca2..3bb4f2f8a 100644 --- a/src/detection/version/version.c +++ b/src/detection/version/version.c @@ -32,7 +32,21 @@ void ffDetectVersion(FFVersionResult* version) version->cmakeBuiltType = FASTFETCH_PROJECT_CMAKE_BUILD_TYPE; version->compileTime = __DATE__ ", " __TIME__; #ifdef __clang__ - version->compiler = "clang " FF_STR(__clang_major__) "." FF_STR(__clang_minor__) "." FF_STR(__clang_patchlevel__); + version->compiler = + #ifdef _MSC_VER + "clang-cl " ; + #elif defined(__APPLE__) && defined(__apple_build_version__) + "Apple clang " + #else + "clang " + #endif + + FF_STR(__clang_major__) "." FF_STR(__clang_minor__) "." FF_STR(__clang_patchlevel__) + + #if defined(__APPLE__) && defined(__apple_build_version__) + " (" FF_STR(__apple_build_version__) ")" + #endif + ; #elif defined(__GNUC__) version->compiler = "gcc " FF_STR(__GNUC__) "." FF_STR(__GNUC_MINOR__) "." FF_STR(__GNUC_PATCHLEVEL__); #elif defined(_MSC_VER)