Removes console from Windows release builds. (#1536)

This commit is contained in:
Kenix3
2022-09-20 23:23:47 -04:00
committed by GitHub
parent d83c6f1753
commit d628bafe29
5 changed files with 42 additions and 10 deletions

View File

@@ -1695,7 +1695,6 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
"NDEBUG"
">"
"INCLUDE_GAME_PRINTF;"
"_CONSOLE;"
"UNICODE;"
"_UNICODE"
STORMLIB_NO_AUTO_LINK
@@ -1710,11 +1709,10 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
"ENABLE_OPENGL"
">"
"$<$<CONFIG:Release>:"
"INCLUDE_GAME_PRINTF;"
"NDEBUG;"
">"
"INCLUDE_GAME_PRINTF;"
"WIN32;"
"_CONSOLE;"
"UNICODE;"
"_UNICODE"
STORMLIB_NO_AUTO_LINK
@@ -1723,7 +1721,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG"
"_DEBUG"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
@@ -1736,7 +1734,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
target_compile_definitions(${PROJECT_NAME} PRIVATE
"$<$<CONFIG:Debug>:"
"_DEBUG"
"_DEBUG"
">"
"$<$<CONFIG:Release>:"
"NDEBUG"
@@ -1799,7 +1797,7 @@ if(MSVC)
/INCREMENTAL:NO
>
/DEBUG;
/SUBSYSTEM:CONSOLE;
/SUBSYSTEM:WINDOWS;
/FORCE:MULTIPLE
)
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
@@ -1814,7 +1812,7 @@ if(MSVC)
/FORCE:MULTIPLE
>
/DEBUG;
/SUBSYSTEM:CONSOLE
/SUBSYSTEM:WINDOWS
)
endif()
endif()

View File

@@ -12,7 +12,7 @@ extern "C"
#include "../../libultraship/libultraship/luslog.h"
#include <soh/Enhancements/item-tables/ItemTableTypes.h>
#if defined(INCLUDE_GAME_PRINTF) && !defined(NDEBUG)
#if defined(INCLUDE_GAME_PRINTF) && defined(_DEBUG)
#define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, __VA_ARGS__)
#else
#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, ##__VA_ARGS__)

View File

@@ -38,7 +38,11 @@ void Main_LogSystemHeap(void) {
osSyncPrintf(VT_RST);
}
#ifdef _WIN32
int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmdshow)
#else
int main(int argc, char** argv)
#endif
{
#ifdef __linux__
SetupHandlerLinux();
@@ -49,6 +53,7 @@ int main(int argc, char** argv)
GameConsole_Init();
InitOTR();
BootCommands_Init();
Main(0);
DeinitOTR();
return 0;