Explicitly use -A Win32 platform in CMake Visual Studio 2019 builds
authorSlawomir Cygan <slawomir.cygan@intel.com>
Fri, 23 Aug 2019 12:33:19 +0000 (14:33 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 29 Aug 2019 09:24:51 +0000 (05:24 -0400)
There is a new CMake switch "-A" for selecting a platform in
Visual Studion CMake generators.

It was set only for 64-bit builds (to x64), however it seems it does not
default to Win32 - so it must be set also for 32-bit builds.

Components: Framework

VK-GL-CTS Issue: 1950

Change-Id: I4d0e9f1a9c8dd0f3060e138f613c8e5326b6fc9f

scripts/build/config.py

index bf6771b..ad264f5 100644 (file)
@@ -133,11 +133,14 @@ class VSProjectGenerator(CMakeGenerator):
 
                platform = None
 
-               if arch == self.ARCH_64BIT:
-                       if version >= 16:
-                               # From VS2019 onwards, the architecture is given by -A <platform-name> switch
+               if version >= 16:
+                       # From VS2019 onwards, the architecture is given by -A <platform-name> switch
+                       if arch == self.ARCH_64BIT:
                                platform = "x64"
-                       else:
+                       elif arch == self.ARCH_32BIT:
+                               platform = "Win32"
+               else:
+                       if arch == self.ARCH_64BIT:
                                name += " Win64"
 
                CMakeGenerator.__init__(self, name, isMultiConfig = True, extraBuildArgs = ['/m'], platform = platform)