aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/system.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-16 10:56:58 +0100
committerGitHub Enterprise <[email protected]>2026-03-16 10:56:58 +0100
commit7079dcf0d77f1ff4cfe66f87f21710068223a8d0 (patch)
tree69f4b4ffea7da9b02e5cbf23b74c19558027007e /src/zencore/system.cpp
parentFix thread vector growth in dynamic thread pools (diff)
parentEnable cross compilation of Windows targets on Linux (#839) (diff)
downloadzen-7079dcf0d77f1ff4cfe66f87f21710068223a8d0.tar.xz
zen-7079dcf0d77f1ff4cfe66f87f21710068223a8d0.zip
Merge branch 'main' into sb/threadpool
Diffstat (limited to 'src/zencore/system.cpp')
-rw-r--r--src/zencore/system.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/zencore/system.cpp b/src/zencore/system.cpp
index 141450b84..8985a8a76 100644
--- a/src/zencore/system.cpp
+++ b/src/zencore/system.cpp
@@ -660,6 +660,24 @@ GetCpuName()
#endif
}
+std::string_view
+GetCompilerName()
+{
+#define ZEN_STRINGIFY_IMPL(x) #x
+#define ZEN_STRINGIFY(x) ZEN_STRINGIFY_IMPL(x)
+#if ZEN_COMPILER_CLANG
+ return "clang " ZEN_STRINGIFY(__clang_major__) "." ZEN_STRINGIFY(__clang_minor__) "." ZEN_STRINGIFY(__clang_patchlevel__);
+#elif ZEN_COMPILER_MSC
+ return "MSVC " ZEN_STRINGIFY(_MSC_VER);
+#elif ZEN_COMPILER_GCC
+ return "GCC " ZEN_STRINGIFY(__GNUC__) "." ZEN_STRINGIFY(__GNUC_MINOR__) "." ZEN_STRINGIFY(__GNUC_PATCHLEVEL__);
+#else
+ return "unknown";
+#endif
+#undef ZEN_STRINGIFY
+#undef ZEN_STRINGIFY_IMPL
+}
+
void
Describe(const SystemMetrics& Metrics, CbWriter& Writer)
{