Skip to content

Commit

Permalink
Merge vk-gl-cts/vulkan-cts-1.1.4 into vk-gl-cts/vulkan-cts-1.1.5
Browse files Browse the repository at this point in the history
Change-Id: I34d0c949c112eb56427e54f1b0f34f730a1d0b27
  • Loading branch information
alegal-arm committed Jul 10, 2019
2 parents b1d28a6 + cab8ce5 commit b3c4c7b
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions scripts/build/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ def findCMake ():
return "cmake"

class CMakeGenerator:
def __init__ (self, name, isMultiConfig = False, extraBuildArgs = []):
def __init__ (self, name, isMultiConfig = False, extraBuildArgs = [], platform = None):
self.name = name
self.isMultiConfig = isMultiConfig
self.extraBuildArgs = copy.copy(extraBuildArgs)
self.platform = platform

def getName (self):
return self.name
Expand All @@ -85,6 +86,10 @@ def getGenerateArgs (self, buildType):
args = ['-G', self.name]
if not self.isMultiConfig:
args.append('-DCMAKE_BUILD_TYPE=%s' % buildType)
if self.platform:
# this is supported since CMake 3.1, needed for VS2019+
args.append('-A')
args.append(self.platform)
return args

def getBuildArgs (self, buildType):
Expand Down Expand Up @@ -125,10 +130,17 @@ class VSProjectGenerator(CMakeGenerator):

def __init__(self, version, arch):
name = "Visual Studio %d" % version

platform = None

if arch == self.ARCH_64BIT:
name += " Win64"
if version >= 16:
# From VS2019 onwards, the architecture is given by -A <platform-name> switch
platform = "x64"
else:
name += " Win64"

CMakeGenerator.__init__(self, name, isMultiConfig = True, extraBuildArgs = ['/m'])
CMakeGenerator.__init__(self, name, isMultiConfig = True, extraBuildArgs = ['/m'], platform = platform)
self.version = version
self.arch = arch

Expand Down Expand Up @@ -167,7 +179,8 @@ def isAvailable (self):
11: [(_winreg.HKEY_CLASSES_ROOT, "VisualStudio.DTE.11.0"), (_winreg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\11.0")],
12: [(_winreg.HKEY_CLASSES_ROOT, "VisualStudio.DTE.12.0"), (_winreg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\12.0")],
14: [(_winreg.HKEY_CLASSES_ROOT, "VisualStudio.DTE.14.0"), (_winreg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\14.0")],
15: [(_winreg.HKEY_CLASSES_ROOT, "VisualStudio.DTE.15.0"), (_winreg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\15.0")]
15: [(_winreg.HKEY_CLASSES_ROOT, "VisualStudio.DTE.15.0"), (_winreg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\15.0")],
16: [(_winreg.HKEY_CLASSES_ROOT, "VisualStudio.DTE.16.0"), (_winreg.HKEY_LOCAL_MACHINE, "Software\\Microsoft\\VCExpress\\16.0")]
}

if not self.version in keyMap:
Expand Down Expand Up @@ -196,6 +209,8 @@ def isAvailable (self):
VS2015_X64_GENERATOR = VSProjectGenerator(14, VSProjectGenerator.ARCH_64BIT)
VS2017_X32_GENERATOR = VSProjectGenerator(15, VSProjectGenerator.ARCH_32BIT)
VS2017_X64_GENERATOR = VSProjectGenerator(15, VSProjectGenerator.ARCH_64BIT)
VS2019_X32_GENERATOR = VSProjectGenerator(16, VSProjectGenerator.ARCH_32BIT)
VS2019_X64_GENERATOR = VSProjectGenerator(16, VSProjectGenerator.ARCH_64BIT)

def selectFirstAvailableGenerator (generators):
for generator in generators:
Expand All @@ -204,13 +219,15 @@ def selectFirstAvailableGenerator (generators):
return None

ANY_VS_X32_GENERATOR = selectFirstAvailableGenerator([
VS2019_X32_GENERATOR,
VS2017_X32_GENERATOR,
VS2015_X32_GENERATOR,
VS2013_X32_GENERATOR,
VS2012_X32_GENERATOR,
VS2010_X32_GENERATOR,
])
ANY_VS_X64_GENERATOR = selectFirstAvailableGenerator([
VS2019_X64_GENERATOR,
VS2017_X64_GENERATOR,
VS2015_X64_GENERATOR,
VS2013_X64_GENERATOR,
Expand All @@ -223,6 +240,8 @@ def selectFirstAvailableGenerator (generators):
NMAKE_GENERATOR,
])
ANY_GENERATOR = selectFirstAvailableGenerator([
VS2019_X64_GENERATOR,
VS2019_X32_GENERATOR,
VS2017_X64_GENERATOR,
VS2017_X32_GENERATOR,
VS2015_X64_GENERATOR,
Expand Down

0 comments on commit b3c4c7b

Please sign in to comment.