aboutsummaryrefslogtreecommitdiff
path: root/backends.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-03-19 21:51:47 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2014-03-19 21:51:47 +0200
commit185fd7b5bc389492cef0c5f16e5eda98057aaf18 (patch)
tree083acea749e15dc1adbcf560a23793dae978ad14 /backends.py
parent9c956b3b08c61e626a7ac759b2d93970c43bdf19 (diff)
downloadmeson-185fd7b5bc389492cef0c5f16e5eda98057aaf18.zip
meson-185fd7b5bc389492cef0c5f16e5eda98057aaf18.tar.gz
meson-185fd7b5bc389492cef0c5f16e5eda98057aaf18.tar.bz2
Now can link with targets and everything.
Diffstat (limited to 'backends.py')
-rw-r--r--backends.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/backends.py b/backends.py
index 3a13390..8a9525e 100644
--- a/backends.py
+++ b/backends.py
@@ -1233,13 +1233,22 @@ class Vs2010Backend(Backend):
ofile = open(sln_filename, 'w')
ofile.write('Microsoft Visual Studio Solution File, Format Version 11.00\n')
ofile.write('# Visual Studio 2010\n')
- prj_templ = prj_line = 'Project("{%s}") = "%s", "%s", "{%s}"\nEndProject\n'
+ prj_templ = prj_line = 'Project("{%s}") = "%s", "%s", "{%s}"\n'
for p in projlist:
prj_line = prj_templ % (self.environment.coredata.guid, p[0], p[1], p[2])
ofile.write(prj_line)
+ pdeps = self.build.targets[p[0]].link_targets
+ if len(pdeps) > 0:
+ ofile.write('\tProjectSection(ProjectDependencies) = postProject\n')
+ for dep in pdeps:
+ guid = self.environment.coredata.target_guids[dep.get_basename()]
+ ofile.write('\t\t{%s} = {%s}\n' % (guid, guid))
+ ofile.write('EndProjectSection\n')
+ ofile.write('EndProject\n')
test_line = prj_templ % (self.environment.coredata.guid,
'RUN_TESTS', 'RUN_TESTS.vcxproj', self.environment.coredata.test_guid)
ofile.write(test_line)
+ ofile.write('EndProject\n')
ofile.write('Global\n')
ofile.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n')
ofile.write('\t\tDebug|Win32 = Debug|Win32\n')
@@ -1354,6 +1363,14 @@ class Vs2010Backend(Backend):
resourcecompile = ET.SubElement(compiles, 'ResourceCompile')
respreproc = ET.SubElement(resourcecompile, 'PreprocessorDefinitions')
link = ET.SubElement(compiles, 'Link')
+ if len(target.link_targets) > 0:
+ links = []
+ for t in target.link_targets:
+ lobj = self.build.targets[t.get_basename()]
+ linkname = lobj.get_filename()
+ links.append(linkname)
+ links.append('%(AdditionalDependencies)')
+ ET.SubElement(link, 'AdditionalDependencies').text = ';'.join(links)
ofile = ET.SubElement(link, 'OutputFile')
ofile.text = '$(OutDir)%s' % target.get_filename()
addlibdir = ET.SubElement(link, 'AdditionalLibraryDirectories')