mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-11 06:23:08 +00:00
fix mac platform sentry no boost and build failed error bug
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#ifdef __APPLE__
|
||||
#include <unistd.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#include <libgen.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include <cstdlib>
|
||||
@@ -64,8 +66,11 @@ void initSentryEx()
|
||||
}
|
||||
|
||||
// Get the directory containing the executable, not the executable path itself
|
||||
boost::filesystem::path exe_dir = boost::filesystem::path(exe_path).parent_path();
|
||||
handlerDir = (exe_dir / "crashpad_handler").string();
|
||||
// Use dirname() to get parent directory (need to copy string as dirname may modify it)
|
||||
char exe_path_copy[PATH_MAX];
|
||||
strncpy(exe_path_copy, exe_path, PATH_MAX);
|
||||
char* exe_dir = dirname(exe_path_copy);
|
||||
handlerDir = std::string(exe_dir) + "/crashpad_handler";
|
||||
|
||||
const char* home_env = getenv("HOME");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user