Browse Source

intermediate changes
ref:58a601d2698ff58961ac0c1c794bf769aed64cee

arcadia-devtools 3 years ago
parent
commit
19152869aa
1 changed files with 11 additions and 6 deletions
  1. 11 6
      build/ymake_conf.py

+ 11 - 6
build/ymake_conf.py

@@ -2289,8 +2289,14 @@ class MSVCToolchainOptions(ToolchainOptions):
 
 class MSVC(object):
     # noinspection PyPep8Naming
-    class WIN32_WINNT(object):
-        Macro = '_WIN32_WINNT'
+    class WindowsVersion(object):
+        """
+        Predefined values for _WIN32_WINNT macro.
+        This macro specifies minimal Windows version required by the binary being build.
+
+        A complete list of the values supported by the Windows SDK can be found at
+        https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt
+        """
         Windows7 = '0x0601'
         Windows8 = '0x0602'
 
@@ -2346,8 +2352,6 @@ class MSVCCompiler(MSVC, Compiler):
 
         target = self.build.target
 
-        win32_winnt = self.WIN32_WINNT.Windows7
-
         warns_enabled = [
             4018,  # 'expression' : signed/unsigned mismatch
             4265,  # 'class' : class has virtual functions, but destructor is not virtual
@@ -2505,8 +2509,9 @@ class MSVCCompiler(MSVC, Compiler):
 
         emit('OBJ_CROSS_SUF', '$OBJ_SUF')
         emit('OBJECT_SUF', '$OBJ_SUF.obj')
-        emit('WIN32_WINNT', '{value}'.format(value=win32_winnt))
-        defines.append('/D{name}=$WIN32_WINNT'.format(name=self.WIN32_WINNT.Macro))
+
+        win_version_min = self.WindowsVersion.Windows7
+        defines.append('/D_WIN32_WINNT={0}'.format(win_version_min))
 
         if winapi_unicode:
             defines += ['/DUNICODE', '/D_UNICODE']