Merge pull request #42065 from Calinou/editor-toggle-console-subsystem

Only display the Windows toggle console option if it can actually be used
This commit is contained in:
Rémi Verschelde 2020-09-15 09:18:58 +02:00 committed by GitHub
commit bc15704c42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -6198,7 +6198,9 @@ EditorNode::EditorNode() {
#else #else
p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREEN); p->add_shortcut(ED_SHORTCUT("editor/fullscreen_mode", TTR("Toggle Fullscreen"), KEY_MASK_SHIFT | KEY_F11), SETTINGS_TOGGLE_FULLSCREEN);
#endif #endif
#ifdef WINDOWS_ENABLED #if defined(WINDOWS_ENABLED) && defined(WINDOWS_SUBSYSTEM_CONSOLE)
// The console can only be toggled if the application was built for the console subsystem,
// not the GUI subsystem.
p->add_item(TTR("Toggle System Console"), SETTINGS_TOGGLE_CONSOLE); p->add_item(TTR("Toggle System Console"), SETTINGS_TOGGLE_CONSOLE);
#endif #endif
p->add_separator(); p->add_separator();

View file

@ -65,12 +65,14 @@ def configure(env):
env.Append(CCFLAGS=["/MD"]) env.Append(CCFLAGS=["/MD"])
env.Append(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(CPPDEFINES=["DEBUG_ENABLED"])
env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"]) env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
env.AppendUnique(CPPDEFINES=["WINDOWS_SUBSYSTEM_CONSOLE"])
elif env["target"] == "debug": elif env["target"] == "debug":
env.Append(CCFLAGS=["/Zi"]) env.Append(CCFLAGS=["/Zi"])
env.Append(CCFLAGS=["/MDd"]) env.Append(CCFLAGS=["/MDd"])
env.Append(CPPDEFINES=["DEBUG_ENABLED"]) env.Append(CPPDEFINES=["DEBUG_ENABLED"])
env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"]) env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
env.AppendUnique(CPPDEFINES=["WINDOWS_SUBSYSTEM_CONSOLE"])
env.Append(LINKFLAGS=["/DEBUG"]) env.Append(LINKFLAGS=["/DEBUG"])
## Compiler configuration ## Compiler configuration

View file

@ -210,6 +210,7 @@ def configure_msvc(env, manual_msvc_config):
env.Append(LINKFLAGS=["/SUBSYSTEM:WINDOWS"]) env.Append(LINKFLAGS=["/SUBSYSTEM:WINDOWS"])
else: else:
env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"]) env.Append(LINKFLAGS=["/SUBSYSTEM:CONSOLE"])
env.AppendUnique(CPPDEFINES=["WINDOWS_SUBSYSTEM_CONSOLE"])
## Compile/link flags ## Compile/link flags
@ -347,6 +348,7 @@ def configure_mingw(env):
env.Append(LINKFLAGS=["-Wl,--subsystem,windows"]) env.Append(LINKFLAGS=["-Wl,--subsystem,windows"])
else: else:
env.Append(LINKFLAGS=["-Wl,--subsystem,console"]) env.Append(LINKFLAGS=["-Wl,--subsystem,console"])
env.AppendUnique(CPPDEFINES=["WINDOWS_SUBSYSTEM_CONSOLE"])
## Compiler configuration ## Compiler configuration