1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-13 23:49:03 +02:00

Merge pull request from tenacityteam/emabrey/build-info-clang

Fix clang compiler build info

Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
Reference-to: https://github.com/tenacityteam/tenacity/pull/626
This commit is contained in:
Emily Mabrey 2021-09-27 01:59:41 -04:00 committed by GitHub
commit ff10653f15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,17 +26,19 @@
class BuildInfo {
public:
enum class CompilerType { MSVC, MinGW, GCC, Clang, Unknown };
enum class CompilerType { MSVC, MinGW, GCC, Clang, AppleClang, Unknown };
static constexpr auto CurrentBuildCompiler =
#if defined(_MSC_FULL_VER)
CompilerType::MSVC;
#elif defined(__GNUC_PATCHLEVEL__) && defined(__MINGW32__)
CompilerType::MinGW;
#elif defined(__GNUC_PATCHLEVEL__)
#elif defined(__GNUC_PATCHLEVEL__) && !defined(__llvm__) && !defined(__clang__)
CompilerType::GCC;
#elif defined(__clang_version__)
#elif defined(__clang_version__) && !defined(__apple_build_version__)
CompilerType::Clang;
#elif defined(__clang_version__) && defined(__apple_build_version__)
CompilerType::AppleClang;
#else
CompilerType::Unknown;
#endif
@ -79,7 +81,16 @@ public:
#define __clang_minor__ 0
#define __clang_patchlevel__ 0
#endif
return wxString::Format( wxT("clang %s"), CUSTOM_wxMAKE_VERSION_DOT_STRING_T(__clang_major__, __clang_minor__, __clang_patchlevel__));
return wxString::Format( wxT("Clang %s"), CUSTOM_wxMAKE_VERSION_DOT_STRING_T(__clang_major__, __clang_minor__, __clang_patchlevel__));
case BuildInfo::CompilerType::AppleClang:
#if !defined(__clang_major__) || !defined (__clang_minor__) || !defined(__clang_patchlevel__)
// This should be unreachable, but it makes the compiler realize that they will always be defined
#define __clang_major__ 0
#define __clang_minor__ 0
#define __clang_patchlevel__ 0
#endif
return wxString::Format( wxT("Apple Clang %s"), CUSTOM_wxMAKE_VERSION_DOT_STRING_T(__clang_major__, __clang_minor__, __clang_patchlevel__));
case BuildInfo::CompilerType::Unknown:
default: