add vs2015 backend

pull/577/head
Nicolas Schneider 9 years ago
parent 0b81f5b0ad
commit 3bedca0257
  1. 15
      mesonbuild/backend/vs2010backend.py
  2. 3
      mesonbuild/coredata.py
  3. 4
      mesonbuild/mesonmain.py
  4. 7
      run_tests.py

@ -39,6 +39,7 @@ class Vs2010Backend(backends.Backend):
super().__init__(build) super().__init__(build)
self.project_file_version = '10.0.30319.1' self.project_file_version = '10.0.30319.1'
self.sources_conflicts = {} self.sources_conflicts = {}
self.platform_toolset = None
def object_filename_from_source(self, target, source): def object_filename_from_source(self, target, source):
basename = os.path.basename(source.fname) basename = os.path.basename(source.fname)
@ -309,6 +310,8 @@ class Vs2010Backend(backends.Backend):
ET.SubElement(type_config, 'ConfigurationType') ET.SubElement(type_config, 'ConfigurationType')
ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte'
ET.SubElement(type_config, 'UseOfMfc').text = 'false' ET.SubElement(type_config, 'UseOfMfc').text = 'false'
if self.platform_toolset:
ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props')
direlem = ET.SubElement(root, 'PropertyGroup') direlem = ET.SubElement(root, 'PropertyGroup')
fver = ET.SubElement(direlem, '_ProjectFileVersion') fver = ET.SubElement(direlem, '_ProjectFileVersion')
@ -441,6 +444,8 @@ class Vs2010Backend(backends.Backend):
type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration')
ET.SubElement(type_config, 'ConfigurationType').text = conftype ET.SubElement(type_config, 'ConfigurationType').text = conftype
ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte'
if self.platform_toolset:
ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset
ET.SubElement(type_config, 'WholeProgramOptimization').text = 'false' ET.SubElement(type_config, 'WholeProgramOptimization').text = 'false'
ET.SubElement(type_config, 'UseDebugLibraries').text = 'true' ET.SubElement(type_config, 'UseDebugLibraries').text = 'true'
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props')
@ -691,6 +696,8 @@ class Vs2010Backend(backends.Backend):
ET.SubElement(type_config, 'ConfigurationType').text = "Utility" ET.SubElement(type_config, 'ConfigurationType').text = "Utility"
ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte'
ET.SubElement(type_config, 'UseOfMfc').text = 'false' ET.SubElement(type_config, 'UseOfMfc').text = 'false'
if self.platform_toolset:
ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props')
direlem = ET.SubElement(root, 'PropertyGroup') direlem = ET.SubElement(root, 'PropertyGroup')
fver = ET.SubElement(direlem, '_ProjectFileVersion') fver = ET.SubElement(direlem, '_ProjectFileVersion')
@ -768,6 +775,8 @@ if %%errorlevel%% neq 0 goto :VCEnd'''
ET.SubElement(type_config, 'ConfigurationType') ET.SubElement(type_config, 'ConfigurationType')
ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte'
ET.SubElement(type_config, 'UseOfMfc').text = 'false' ET.SubElement(type_config, 'UseOfMfc').text = 'false'
if self.platform_toolset:
ET.SubElement(type_config, 'PlatformToolset').text = self.platform_toolset
ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props') ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.props')
direlem = ET.SubElement(root, 'PropertyGroup') direlem = ET.SubElement(root, 'PropertyGroup')
fver = ET.SubElement(direlem, '_ProjectFileVersion') fver = ET.SubElement(direlem, '_ProjectFileVersion')
@ -811,3 +820,9 @@ if %%errorlevel%% neq 0 goto :VCEnd'''
# ElementTree can not do prettyprinting so do it manually # ElementTree can not do prettyprinting so do it manually
#doc = xml.dom.minidom.parse(ofname) #doc = xml.dom.minidom.parse(ofname)
#open(ofname, 'w').write(doc.toprettyxml()) #open(ofname, 'w').write(doc.toprettyxml())
class Vs2015Backend(Vs2010Backend):
def __init__(self, build):
super().__init__(build)
self.platform_toolset = 'v140'

@ -16,6 +16,7 @@ import pickle, os, uuid
from .mesonlib import MesonException, default_libdir, default_libexecdir, default_prefix from .mesonlib import MesonException, default_libdir, default_libexecdir, default_prefix
version = '0.32.0.dev1' version = '0.32.0.dev1'
backendlist = ['ninja', 'vs2010', 'vs2015', 'xcode']
class UserOption: class UserOption:
def __init__(self, name, description, choices): def __init__(self, name, description, choices):
@ -209,7 +210,7 @@ builtin_options = {
'warning_level' : [ UserComboOption, 'Compiler warning level to use.', [ '1', '2', '3' ], '1'], 'warning_level' : [ UserComboOption, 'Compiler warning level to use.', [ '1', '2', '3' ], '1'],
'layout' : [ UserComboOption, 'Build directory layout.', ['mirror', 'flat' ], 'mirror' ], 'layout' : [ UserComboOption, 'Build directory layout.', ['mirror', 'flat' ], 'mirror' ],
'default_library' : [ UserComboOption, 'Default library type.', [ 'shared', 'static' ], 'shared' ], 'default_library' : [ UserComboOption, 'Default library type.', [ 'shared', 'static' ], 'shared' ],
'backend' : [ UserComboOption, 'Backend to use.', [ 'ninja', 'vs2010', 'xcode' ], 'ninja' ], 'backend' : [ UserComboOption, 'Backend to use.', backendlist, 'ninja' ],
'stdsplit' : [ UserBooleanOption, 'Split stdout and stderr in test logs.', True ], 'stdsplit' : [ UserBooleanOption, 'Split stdout and stderr in test logs.', True ],
'errorlogs' : [ UserBooleanOption, "Whether to print the logs from failing tests.", False ], 'errorlogs' : [ UserBooleanOption, "Whether to print the logs from failing tests.", False ],
} }

@ -23,7 +23,6 @@ import platform
from . import mlog, coredata from . import mlog, coredata
from .mesonlib import MesonException from .mesonlib import MesonException
backendlist = ['ninja', 'vs2010', 'xcode']
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
@ -139,6 +138,9 @@ itself as required.'''
elif self.options.backend == 'vs2010': elif self.options.backend == 'vs2010':
from .backend import vs2010backend from .backend import vs2010backend
g = vs2010backend.Vs2010Backend(b) g = vs2010backend.Vs2010Backend(b)
elif self.options.backend == 'vs2015':
from .backend import vs2010backend
g = vs2010backend.Vs2015Backend(b)
elif self.options.backend == 'xcode': elif self.options.backend == 'xcode':
from .backend import xcodebackend from .backend import xcodebackend
g = xcodebackend.XCodeBackend(b) g = xcodebackend.XCodeBackend(b)

@ -31,7 +31,7 @@ import time
import multiprocessing import multiprocessing
import concurrent.futures as conc import concurrent.futures as conc
from mesonbuild.mesonmain import backendlist from mesonbuild.coredata import backendlist
class TestResult: class TestResult:
def __init__(self, msg, stdo, stde, conftime=0, buildtime=0, testtime=0): def __init__(self, msg, stdo, stde, conftime=0, buildtime=0, testtime=0):
@ -100,6 +100,11 @@ def setup_commands(backend):
compile_commands = ['msbuild'] compile_commands = ['msbuild']
test_commands = ['msbuild', 'RUN_TESTS.vcxproj'] test_commands = ['msbuild', 'RUN_TESTS.vcxproj']
install_commands = [] install_commands = []
elif backend == 'vs2015':
backend_flags = ['--backend=vs2015']
compile_commands = ['msbuild']
test_commands = ['msbuild', 'RUN_TESTS.vcxproj']
install_commands = []
elif backend == 'xcode' or (backend is None and mesonlib.is_osx()): elif backend == 'xcode' or (backend is None and mesonlib.is_osx()):
backend_flags = ['--backend=xcode'] backend_flags = ['--backend=xcode']
compile_commands = ['xcodebuild'] compile_commands = ['xcodebuild']

Loading…
Cancel
Save