Fix managed C++ linking of unmanaged library dependencies

This commit is contained in:
Jason Perkins 2014-10-02 16:40:28 -04:00
parent 157d96e39d
commit 428b9cad2f
2 changed files with 65 additions and 9 deletions

View File

@ -822,9 +822,20 @@
--
m.elements.projectReferences = function(prj, ref)
return {
m.projectReferenceProject,
}
if prj.flags.Managed then
return {
m.referenceProject,
m.referencePrivate,
m.referenceOutputAssembly,
m.referenceCopyLocalSatelliteAssemblies,
m.referenceLinkLibraryDependencies,
m.referenceUseLibraryDependences,
}
else
return {
m.referenceProject,
}
end
end
function m.projectReferences(prj)
@ -1391,11 +1402,6 @@
end
function m.projectReferenceProject(prj, ref)
p.w('<Project>{%s}</Project>', ref.uuid)
end
function m.propertyGroup(cfg, label)
local cond
if cfg then
@ -1418,7 +1424,6 @@
end
function m.propertySheetGroup(prj)
for cfg in project.eachconfig(prj) do
m.propertySheets(cfg)
@ -1426,6 +1431,35 @@
end
function m.referenceCopyLocalSatelliteAssemblies(prj, ref)
p.w('<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>')
end
function m.referenceLinkLibraryDependencies(prj, ref)
p.w('<LinkLibraryDependencies>true</LinkLibraryDependencies>')
end
function m.referenceOutputAssembly(prj, ref)
p.w('<ReferenceOutputAssembly>true</ReferenceOutputAssembly>')
end
function m.referencePrivate(prj, ref)
p.w('<Private>true</Private>')
end
function m.referenceProject(prj, ref)
p.w('<Project>{%s}</Project>', ref.uuid)
end
function m.referenceUseLibraryDependences(prj, ref)
p.w('<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>')
end
function m.resourceAdditionalIncludeDirectories(cfg)
m.additionalIncludeDirectories(cfg, table.join(cfg.includedirs, cfg.resincludedirs))

View File

@ -75,3 +75,25 @@
]]
end
--
-- Managed C++ projects write out references a little differently.
--
function suite.referencesAreRelative_onDifferentProjectLocation()
links { "MyProject" }
flags { "Managed" }
prepare()
test.capture [[
<ItemGroup>
<ProjectReference Include="MyProject.vcxproj">
<Project>{00112233-4455-6677-8888-99AABBCCDDEE}</Project>
<Private>true</Private>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
<CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
<UseLibraryDependencyInputs>false</UseLibraryDependencyInputs>
</ProjectReference>
</ItemGroup>
]]
end