diff options
Diffstat (limited to 'platform/windows/detect.py')
-rw-r--r-- | platform/windows/detect.py | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/platform/windows/detect.py b/platform/windows/detect.py index 500736bd3f..cc859c0339 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -1,6 +1,9 @@ import methods import os +# To match other platforms +STACK_SIZE = 8388608 + def is_active(): return True @@ -207,7 +210,7 @@ def configure_msvc(env, manual_msvc_config): else: print("Missing environment variable: WindowsSdkDir") - env.AppendUnique(CPPDEFINES = ['WINDOWS_ENABLED', 'OPENGL_ENABLED', + env.AppendUnique(CPPDEFINES = ['WINDOWS_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED', 'TYPED_METHOD_BIND', 'WIN32', 'MSVC', @@ -219,10 +222,20 @@ def configure_msvc(env, manual_msvc_config): ## Libs - LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32', + LIBS = ['winmm', 'dsound', 'kernel32', 'ole32', 'oleaut32', 'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32', - 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt','Avrt', + 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32', 'bcrypt', 'Avrt', 'dwmapi'] + + env.AppendUnique(CPPDEFINES=['VULKAN_ENABLED']) + if not env['builtin_vulkan']: + LIBS += ['vulkan'] + else: + LIBS += ['cfgmgr32'] + + #env.AppendUnique(CPPDEFINES = ['OPENGL_ENABLED']) + LIBS += ['opengl32'] + env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS]) if manual_msvc_config: @@ -249,6 +262,8 @@ def configure_msvc(env, manual_msvc_config): env['BUILDERS']['ProgramOriginal'] = env['BUILDERS']['Program'] env['BUILDERS']['Program'] = methods.precious_program + env.AppendUnique(LINKFLAGS=['/STACK:' + str(STACK_SIZE)]) + def configure_mingw(env): # Workaround for MinGW. See: # http://www.scons.org/wiki/LongCmdLinesOnWin32 @@ -293,12 +308,7 @@ def configure_mingw(env): ## Compiler configuration - if (os.name == "nt"): - # Force splitting libmodules.a in multiple chunks to work around - # issues reaching the linker command line size limit, which also - # seem to induce huge slowdown for 'ar' (GH-30892). - env['split_libmodules'] = True - else: + if os.name != "nt": env["PROGSUFFIX"] = env["PROGSUFFIX"] + ".exe" # for linux cross-compilation if (env["bits"] == "default"): @@ -346,13 +356,25 @@ def configure_mingw(env): env.Append(CCFLAGS=['-flto']) env.Append(LINKFLAGS=['-flto']) + env.Append(LINKFLAGS=['-Wl,--stack,' + str(STACK_SIZE)]) ## Compile flags env.Append(CCFLAGS=['-mwindows']) - env.Append(CPPDEFINES=['WINDOWS_ENABLED', 'OPENGL_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED']) + + env.Append(CPPDEFINES=['WINDOWS_ENABLED', 'WASAPI_ENABLED', 'WINMIDI_ENABLED']) env.Append(CPPDEFINES=[('WINVER', env['target_win_version']), ('_WIN32_WINNT', env['target_win_version'])]) - env.Append(LIBS=['mingw32', 'opengl32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid', 'dwmapi']) + env.Append(LIBS=['mingw32', 'dsound', 'ole32', 'd3d9', 'winmm', 'gdi32', 'iphlpapi', 'shlwapi', 'wsock32', 'ws2_32', 'kernel32', 'oleaut32', 'dinput8', 'dxguid', 'ksuser', 'imm32', 'bcrypt', 'avrt', 'uuid', 'dwmapi']) + + env.Append(CPPDEFINES=['VULKAN_ENABLED']) + if not env['builtin_vulkan']: + env.Append(LIBS=['vulkan']) + else: + env.Append(LIBS=['cfgmgr32']) + + ## TODO !!! Reenable when OpenGLES Rendering Device is implemented !!! + #env.Append(CPPDEFINES=['OPENGL_ENABLED']) + env.Append(LIBS=['opengl32']) env.Append(CPPDEFINES=['MINGW_ENABLED', ('MINGW_HAS_SECURE_API', 1)]) |