diff options
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 9 | ||||
-rw-r--r-- | mesonbuild/backend/vs2017backend.py | 27 |
2 files changed, 36 insertions, 0 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index e1f7325..6b4859d 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -62,6 +62,7 @@ class Vs2010Backend(backends.Backend): self.sources_conflicts = {} self.platform_toolset = None self.vs_version = '2010' + self.windows_target_platform_version = None def object_filename_from_source(self, target, source): basename = os.path.basename(source.fname) @@ -354,6 +355,8 @@ class Vs2010Backend(backends.Backend): p.text = self.platform pname = ET.SubElement(globalgroup, 'ProjectName') pname.text = project_name + if self.windows_target_platform_version: + ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType') @@ -589,6 +592,8 @@ class Vs2010Backend(backends.Backend): p.text = self.platform pname = ET.SubElement(globalgroup, 'ProjectName') pname.text = project_name + if self.windows_target_platform_version: + ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') # Start configuration type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') @@ -1006,6 +1011,8 @@ class Vs2010Backend(backends.Backend): p.text = self.platform pname = ET.SubElement(globalgroup, 'ProjectName') pname.text = project_name + if self.windows_target_platform_version: + ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType').text = "Utility" @@ -1085,6 +1092,8 @@ if %%errorlevel%% neq 0 goto :VCEnd''' p.text = self.platform pname = ET.SubElement(globalgroup, 'ProjectName') pname.text = project_name + if self.windows_target_platform_version: + ET.SubElement(globalgroup, 'WindowsTargetPlatformVersion').text = self.windows_target_platform_version ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') ET.SubElement(type_config, 'ConfigurationType') diff --git a/mesonbuild/backend/vs2017backend.py b/mesonbuild/backend/vs2017backend.py new file mode 100644 index 0000000..8301790 --- /dev/null +++ b/mesonbuild/backend/vs2017backend.py @@ -0,0 +1,27 @@ +# Copyright 2014-2016 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os + +from .vs2010backend import Vs2010Backend + + +class Vs2017Backend(Vs2010Backend): + def __init__(self, build): + super().__init__(build) + self.name = 'vs2017' + self.platform_toolset = 'v141' + self.vs_version = '2017' + # WindowsSDKVersion should be set by command prompt. + self.windows_target_platform_version = os.getenv('WindowsSDKVersion', None) |