|
@@ -8,22 +8,26 @@
|
|
|
*
|
|
|
*/
|
|
|
#pragma once
|
|
|
-#ifdef WINDOWS_BUILD
|
|
|
-//widnows
|
|
|
-#include <Windows.h>
|
|
|
-#include <Dbghelp.h>
|
|
|
-#pragma comment (lib,"Dbghelp.lib")
|
|
|
//stl
|
|
|
#include <iostream>
|
|
|
//robotics
|
|
|
#include "logger.hpp"
|
|
|
#include "datetime.hpp"
|
|
|
|
|
|
-#ifdef DUMP_INSTALL
|
|
|
-#else
|
|
|
+#ifndef DUMP_INSTALL
|
|
|
+#ifdef WINDOWS_BUILD
|
|
|
#define DUMP_INSTALL robotics::v3::dump::install()
|
|
|
+#elif LINUX_BUILD
|
|
|
+#define DUMP_INSTALL
|
|
|
+#endif
|
|
|
#endif // DUMP_INSTALL
|
|
|
|
|
|
+#ifdef WINDOWS_BUILD
|
|
|
+//widnows
|
|
|
+#include <Windows.h>
|
|
|
+#include <Dbghelp.h>
|
|
|
+#pragma comment (lib,"Dbghelp.lib")
|
|
|
+
|
|
|
namespace robotics {
|
|
|
namespace v3 {
|
|
|
class dump {
|
|
@@ -79,7 +83,9 @@ namespace robotics {
|
|
|
}
|
|
|
static std::string get_dump_file_name() {
|
|
|
std::string currentTime = v3::datetime::current_datetime().to_string("yyyy_MM_dd_HH_mm_ss_fff");
|
|
|
- std::filesystem::path path = std::filesystem::current_path();
|
|
|
+ char filename[512] = { 0 };
|
|
|
+ GetModuleFileNameA(NULL, filename, 512);
|
|
|
+ std::filesystem::path path = filename;
|
|
|
path /= "dump";
|
|
|
if (!std::filesystem::exists(path)) {
|
|
|
std::filesystem::create_directory(path);
|