summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2019-05-16 12:48:01 -0500
committerChad Elliott <elliottc@objectcomputing.com>2019-05-16 12:48:01 -0500
commit63bd8ccba21971d3e2d03f96834ac32e7a3902d2 (patch)
tree33875eca72726656eb88e2fadb0742b3847d87e7 /modules
parentbdcd527ae2260b791a5edf2033dbafcd5811e15c (diff)
downloadMPC-63bd8ccba21971d3e2d03f96834ac32e7a3902d2.tar.gz
Thu May 16 17:46:26 UTC 2019 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/DirectoryManager.pm2
-rw-r--r--modules/IARWorkspaceCreator.pm7
-rw-r--r--modules/TemplateParser.pm23
3 files changed, 29 insertions, 3 deletions
diff --git a/modules/DirectoryManager.pm b/modules/DirectoryManager.pm
index 55845159..6dfdd92d 100644
--- a/modules/DirectoryManager.pm
+++ b/modules/DirectoryManager.pm
@@ -196,7 +196,7 @@ sub path_is_relative {
## To determine if the path is relative, we just determine if it is not
## an absolute path.
#my($self, $path) = @_;
- return (index($_[1], '/') != 0 && $_[1] !~ /^[A-Z]:\//i);
+ return (index($_[1], '/') != 0 && $_[1] !~ /^[A-Z]:[\/\\]/i && $_[1] !~ /^\$\(\w+\)/);
}
# ************************************************************
diff --git a/modules/IARWorkspaceCreator.pm b/modules/IARWorkspaceCreator.pm
index 5f339c6b..ff17ae31 100644
--- a/modules/IARWorkspaceCreator.pm
+++ b/modules/IARWorkspaceCreator.pm
@@ -53,9 +53,12 @@ sub write_comps {
$self->create_command_line_string($0, @ARGV),
' -->', $crlf;
foreach my $project ($self->sort_dependencies($self->get_projects(), 0)) {
+ ## Only emit the prefix if the path is relative. IAR requires it unless
+ ## the path is fully qualified.
print $fh " <project>$crlf",
- " <path>\$WS_DIR\$\\", $self->slash_to_backslash($project),
- "</path>$crlf",
+ " <path>";
+ print $fh '$WS_DIR$\\' if ($self->path_is_relative($project));
+ print $fh $self->slash_to_backslash($project), "</path>$crlf",
" </project>$crlf";
}
}
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm
index 76615028..723e524a 100644
--- a/modules/TemplateParser.pm
+++ b/modules/TemplateParser.pm
@@ -91,6 +91,7 @@ my %keywords = ('if' => 0,
'new_guid' => 0,
'deref' => 0,
'set' => 0,
+ 'is_relative' => $get_type|$doif_type|$get_combined_type,
);
my %target_type_vars = ('type_is_static' => 1,
@@ -1991,6 +1992,28 @@ sub handle_set {
}
}
+
+sub get_is_relative {
+ my($self, $name) = @_;
+ return $self->doif_is_relative($self->get_value_with_default($name));
+}
+
+
+sub doif_is_relative {
+ my($self, $val) = @_;
+ return $self->{'prjc'}->path_is_relative($val) if (defined $val);
+ return undef;
+}
+
+
+sub handle_is_relative {
+ my($self, $name) = @_;
+ my $val = $self->get_value_with_default($name);
+ $self->append_current(
+ $self->{'prjc'}->path_is_relative($val) ? '1' : '0') if (defined $val);
+}
+
+
sub prepare_parameters {
my($self, $prefix) = @_;
my $input = $self->get_value($prefix . '->input_file');