From 9c956b3b08c61e626a7ac759b2d93970c43bdf19 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 19 Mar 2014 21:06:39 +0200 Subject: [PATCH] Can build all three target types. --- backends.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/backends.py b/backends.py index f5bad2b5d..3a1339032 100644 --- a/backends.py +++ b/backends.py @@ -1283,7 +1283,16 @@ class Vs2010Backend(Backend): platform = "Win32" project_name = target.name target_name = target.name - subsystem = 'console' + subsystem = 'Windows' + if isinstance(target, build.Executable): + conftype = 'Application' + subsystem = 'Console' + elif isinstance(target, build.StaticLibrary): + conftype = 'StaticLibrary' + elif isinstance(target, build.SharedLibrary): + conftype = 'SharedLibrary' + else: + raise MesonException('Unknown target type for %s' % target_name) root = ET.Element('Project', {'DefaultTargets' : "Build", 'ToolsVersion' : '4.0', 'xmlns' : 'http://schemas.microsoft.com/developer/msbuild/2003'}) @@ -1306,7 +1315,7 @@ class Vs2010Backend(Backend): pname.text = project_name ET.SubElement(root, 'Import', Project='$(VCTargetsPath)\Microsoft.Cpp.Default.props') type_config = ET.SubElement(root, 'PropertyGroup', Label='Configuration') - ET.SubElement(type_config, 'ConfigurationType').text = 'Application' + ET.SubElement(type_config, 'ConfigurationType').text = conftype ET.SubElement(type_config, 'CharacterSet').text = 'MultiByte' ET.SubElement(type_config, 'WholeProgramOptimization').text = 'false' ET.SubElement(type_config, 'UseDebugLibraries').text = 'true'