From ccf086c39f734a000aa3a2fac034f0620021fbdf Mon Sep 17 00:00:00 2001 From: vimene Date: Thu, 5 Feb 2026 10:31:47 +0100 Subject: added back windows cross-compilation Makefile.am is too ugly, but I don't have a better solution right now. - fused Makefile.am and src/Makefile.am - adding back windows cross-compilation - improved README.md a lot - added configure option to enable debug, which greatly simplifies development when writing shaders - removed dependency on LunarG's Vulkan SDK by having dependency only on Vulkan headers, library and slangc - removed print C++ header because I have an old MinGW which doesn't support it. It will be restored in the future - make every assets path relative to be able to build anywhere and run elsewhere - moved stb_image.h inside source directory instead of making it a dependency, which is more aligned with stb philosophy - moved assets inside source code to make it easy to compile and run the engine - improved configure.ac by checking Vulkan headers version directly in the configure script instead of within C code, which allows us to also do theses checks when cross-compiling --- src/path_utils.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/path_utils.cpp (limited to 'src/path_utils.cpp') diff --git a/src/path_utils.cpp b/src/path_utils.cpp new file mode 100644 index 0000000..df35ef1 --- /dev/null +++ b/src/path_utils.cpp @@ -0,0 +1,20 @@ +#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 +} -- cgit v1.2.3