~tenacity/tenacity

ff10653f1550b2adf9d2b30d3b39d156d4d6d691 — Emily Mabrey 8 months ago 198d49b + 41e73e1
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
1 files changed, 15 insertions(+), 4 deletions(-)

M src/BuildInfo.h
M src/BuildInfo.h => src/BuildInfo.h +15 -4
@@ 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: