From faceb5b75d512376afd27efbfcf4066a9fdf2952 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Sun, 13 May 2018 22:32:01 +0200 Subject: [PATCH] Implement pull/18665 for 3.0 Windows detect.py: Detect missing WindowsSdkDir --- platform/windows/detect.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index ffadaf0f7f2..0430e5f77e8 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -167,7 +167,10 @@ def configure(env): env.Append(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo']) env.Append(CXXFLAGS=['/TP']) env.Append(CPPFLAGS=['/DMSVC', '/GR', ]) - env.Append(CCFLAGS=['/I' + os.getenv("WindowsSdkDir") + "/Include"]) + if os.getenv("WindowsSdkDir") is not None: + env.Append(CCFLAGS=['/I' + os.getenv("WindowsSdkDir") + "/Include"]) + else: + print("Missing environment variable: WindowsSdkDir") env.Append(CCFLAGS=['/DWINDOWS_ENABLED']) env.Append(CCFLAGS=['/DOPENGL_ENABLED']) @@ -182,7 +185,10 @@ def configure(env): LIBS = ['winmm', 'opengl32', 'dsound', 'kernel32', 'ole32', 'oleaut32', 'user32', 'gdi32', 'IPHLPAPI', 'Shlwapi', 'wsock32', 'Ws2_32', 'shell32', 'advapi32', 'dinput8', 'dxguid', 'imm32'] env.Append(LINKFLAGS=[p + env["LIBSUFFIX"] for p in LIBS]) - env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"]) + if os.getenv("WindowsSdkDir") is not None: + env.Append(LIBPATH=[os.getenv("WindowsSdkDir") + "/Lib"]) + else: + print("Missing environment variable: WindowsSdkDir") if (os.getenv("VCINSTALLDIR")): VC_PATH = os.getenv("VCINSTALLDIR")