From 88df6d1d145150710b8cb3c46f7153953d069656 Mon Sep 17 00:00:00 2001 From: Harrand Date: Thu, 31 Oct 2024 20:05:55 +0000 Subject: [PATCH] [entrypoint] added tz/main.hpp to provide support for the tz_main entry point. this is because all executables created by topaz_add_executable are now GUI applications on windows instead of console applications. however, this forces us to deal wit the stupid monstrous nonsense that is WinMain. so tz_main is defined to whatever is needed (does nothing if you're not on windows of course) --- cmake/topaz.cmake | 2 +- include/tz/main.hpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 include/tz/main.hpp diff --git a/cmake/topaz.cmake b/cmake/topaz.cmake index 7288cd2166..1264a62bdc 100644 --- a/cmake/topaz.cmake +++ b/cmake/topaz.cmake @@ -43,7 +43,7 @@ function(topaz_add_executable) ${ARGN} ) - add_executable(${TOPAZ_ADD_EXECUTABLE_TARGET} + add_executable(${TOPAZ_ADD_EXECUTABLE_TARGET} WIN32 ${TOPAZ_ADD_EXECUTABLE_SOURCES} ) topaz_add_shader( diff --git a/include/tz/main.hpp b/include/tz/main.hpp new file mode 100644 index 0000000000..e35d5077a7 --- /dev/null +++ b/include/tz/main.hpp @@ -0,0 +1,7 @@ +#ifndef TZMAIN_HPP +#ifdef _WIN32 + #define NOMINMAX + #include + #define tz_main() WINAPI wWinMain([[maybe_unused]] HINSTANCE, [[maybe_unused]] HINSTANCE,[[maybe_unused]] LPWSTR, [[maybe_unused]] _In_ int) +#endif +#endif // TZMAIN_HPP \ No newline at end of file