Browse Source

Set WINVER and _WIN32_WINNT values in VS project

While looking into a different issue, I've noticed that Visual Studio Intellisense does not work well for Godot project when using Windows Vista+ APIs (e.g. CreateThreadpool), i.e. it does not recognise the APIs because they are defined in Windows header files for Vista+ only.

This is because the WINVER and _WIN32_WINNT symbols don't have their values set in the generated Godot project file. This fixes the problem by setting the values when generating the project file.
Marcin Zawiejski 6 years ago
parent
commit
9ca649c67b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      platform/windows/detect.py

+ 2 - 2
platform/windows/detect.py

@@ -208,8 +208,8 @@ def configure_msvc(env, manual_msvc_config):
                                    'RTAUDIO_ENABLED', 'WASAPI_ENABLED',
                                    'RTAUDIO_ENABLED', 'WASAPI_ENABLED',
                                    'WINMIDI_ENABLED', 'TYPED_METHOD_BIND',
                                    'WINMIDI_ENABLED', 'TYPED_METHOD_BIND',
                                    'WIN32', 'MSVC',
                                    'WIN32', 'MSVC',
-                                   'WINVER=$target_win_version',
-                                   '_WIN32_WINNT=$target_win_version'])
+                                   'WINVER=%s' % env["target_win_version"],
+                                   '_WIN32_WINNT=%s' % env["target_win_version"]])
     env.AppendUnique(CPPDEFINES=['NOMINMAX']) # disable bogus min/max WinDef.h macros
     env.AppendUnique(CPPDEFINES=['NOMINMAX']) # disable bogus min/max WinDef.h macros
     if env["bits"] == "64":
     if env["bits"] == "64":
         env.AppendUnique(CPPDEFINES=['_WIN64'])
         env.AppendUnique(CPPDEFINES=['_WIN64'])