summaryrefslogtreecommitdiff
path: root/modules/VC8WorkspaceCreator.pm
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2009-08-19 02:11:50 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2009-08-19 02:11:50 +0000
commit521ecaf0d7aebf13e7d42a71d5a86e9d94c60e43 (patch)
tree0a43cb78ceff32479a0ede84db794c143ca749c7 /modules/VC8WorkspaceCreator.pm
parent315d2a2dd3220e48ab836662c168a9cacc3d4585 (diff)
downloadMPC-521ecaf0d7aebf13e7d42a71d5a86e9d94c60e43.tar.gz
ChangeLogTag: Wed Aug 19 02:11:03 UTC 2009 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules/VC8WorkspaceCreator.pm')
-rw-r--r--modules/VC8WorkspaceCreator.pm34
1 files changed, 22 insertions, 12 deletions
diff --git a/modules/VC8WorkspaceCreator.pm b/modules/VC8WorkspaceCreator.pm
index ac677852..13a7bf26 100644
--- a/modules/VC8WorkspaceCreator.pm
+++ b/modules/VC8WorkspaceCreator.pm
@@ -59,8 +59,8 @@ sub post_workspace {
## Store a map of the project name to project guid
foreach my $project (@projects) {
- my($name, $deps, $guid) = @{$$pjs{$project}};
- $gmap{$name} = $guid;
+ my($name, $deps, $guid, $lang, $custom_only, $nocross, $managed) = @{$$pjs{$project}};
+ $gmap{$name} = [$guid, $managed || $lang ne Creator::cplusplus];
}
## Now go through the projects and check for the need to add external
@@ -74,31 +74,41 @@ sub post_workspace {
my @read;
my $crlf = $self->crlf();
my $cwd = $self->getcwd();
+ my $lang = $$pjs{$project}->[3];
+ my $managed = $$pjs{$project}->[6];
while(<$ph>) {
## This is a comment found in vc8.mpd if the project contains the
## 'after' keyword setting and the 'add_references' template
## variable setting.
- if (/^(\s*)<!\-\-\s+MPC\s+ADD\s+DEPENDENCIES\s+([^\s]+)?/) {
+ if (/^(\s*)<!\-\-\s+MPC\s+ADD\s+DEPENDENCIES/) {
my $spc = $1;
- my $lang = $2;
my $deps = $self->get_validated_ordering($project);
foreach my $dep (@$deps) {
my $relative = $self->get_relative_dep_file($creator,
"$cwd/$project",
$dep);
if (defined $relative) {
- if (defined $lang && $lang eq Creator::cplusplus) {
- push(@read, $spc . '<ProjectReference' . $crlf .
- $spc . "\tReferencedProjectIdentifier=" .
- "\"\{$gmap{$dep}\}\"$crlf" .
- $spc . "\tRelativePathToProject=\"$relative\"$crlf" .
- $spc . '/>' . $crlf);
+ if ($lang eq Creator::cplusplus) {
+ ## If the current project is not managed, then we will
+ ## add references (although I doubt that will be useful).
+ ## If the current project is managed, then the reference
+ ## project must be managed or a non-c++ project.
+ if (!$managed || ($managed && $gmap{$dep}->[1])) {
+ push(@read, $spc . '<ProjectReference' . $crlf .
+ $spc . "\tReferencedProjectIdentifier=" .
+ "\"\{$gmap{$dep}->[0]\}\"$crlf" .
+ $spc . "\tRelativePathToProject=\"$relative\"$crlf" .
+ $spc . '/>' . $crlf);
+ }
}
- else {
+ ## This is a non-c++ language. So, it should not reference
+ ## unmanaged c++ libraries. If it's a managed project or
+ ## it's not a c++ project, it's ok to add a reference.
+ elsif ($gmap{$dep}->[1]) {
push(@read, $spc . '<ProjectReference Include="' .
$relative . '">' . $crlf,
- $spc . ' <Project>{' . $gmap{$dep} .
+ $spc . ' <Project>{' . $gmap{$dep}->[0] .
'}</Project>' . $crlf,
$spc . ' <Name>' . $dep . '</Name>' . $crlf,
$spc . '</ProjectReference>' . $crlf);