Files
Fig-TreeWalker/src/Core/executablePath.hpp
PuqiAR ccf80536b3
All checks were successful
Release Build / build-windows-x64 (push) Successful in 47s
Release Build / build-linux-x64 (push) Successful in 58s
[Fix] 蠢蛋clang!
2026-01-14 21:35:48 +08:00

21 lines
412 B
C++

#pragma once
#include <filesystem>
#ifdef _WIN32
#include <libloaderapi.h>
#endif
namespace Fig
{
inline std::filesystem::path getExecutablePath()
{
#ifdef _WIN32
wchar_t buffer[MAX_PATH];
GetModuleFileNameW(nullptr, buffer, MAX_PATH);
return std::filesystem::path(buffer);
#else
return std::filesystem::canonical("/proc/self/exe");
#endif
}
}; // namespace Fig