From a795c21962bce25f924248be2648324d35bc0dc0 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 31 Jan 2021 19:34:39 +0100 Subject: [PATCH] Get process executable path on macos. --- client/TracyProfiler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index bf48c92e..5d0ca5e6 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -39,6 +39,7 @@ #if defined __APPLE__ # include "TargetConditionals.h" +# include #endif #ifdef __ANDROID__ @@ -287,6 +288,11 @@ static const char* GetProcessExecutablePath() return buf; #elif defined _GNU_SOURCE || defined __CYGWIN__ return program_invocation_name; +#elif defined __APPLE__ + static char buf[1024]; + uint32_t size = 1024; + _NSGetExecutablePath( buf, &size ); + return buf; #else return nullptr; #endif