#include "path_utils.hpp" #include #include #ifdef _WIN32 # include # include #endif std::optional engine::path_utils::exe_path() noexcept { #if defined(_WIN32) TCHAR filename[MAX_PATH]; if (!GetModuleFileName(NULL, filename, MAX_PATH)) return {}; return std::filesystem::path(filename); #elif defined(linux) return std::filesystem::canonical("/proc/self/exe"); #else # error "operating system not supported" #endif }