Skip to content

Commit 436fd25

Browse files
authored
Merge branch 'master' into master
2 parents 36dcad6 + 4cbc59f commit 436fd25

File tree

6 files changed

+97
-43
lines changed

6 files changed

+97
-43
lines changed

.github/workflows/windows.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ jobs:
8181
'{"name": "tao","version-string": "githubaction","dependencies": [ ${{ matrix.vcpkgpackages }} ]}' > vcpkg.json
8282
shell: pwsh
8383
- name: Install vcpkg
84-
uses: lukka/run-vcpkg@v10
84+
uses: lukka/run-vcpkg@v11
8585
with:
86-
vcpkgGitCommitId: 94ce0dab56f4d8ba6bd631ba59ed682b02d45c46
87-
appendedCacheKey: ${{ matrix.name }}
86+
vcpkgGitCommitId: 5b1214315250939257ef5d62ecdcbca18cf4fb1c
8887
runVcpkgInstall: true
8988
- name: create $ACE_ROOT/ace/config.h
9089
run: |

create_base.pl

+14-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
# Data Section
3333
# ******************************************************************
3434

35-
my $version = '0.1';
35+
my $version = '0.2';
3636

3737
# ******************************************************************
3838
# Subroutine Section
@@ -45,6 +45,8 @@ sub gather_info {
4545
if (open($fh, $name)) {
4646
my @lines = ();
4747
my $pname = undef;
48+
my $pline = undef;
49+
4850
while(<$fh>) {
4951
## Get the line a remove leading and trailing white space
5052
my $line = $_;
@@ -81,6 +83,7 @@ sub gather_info {
8183
## us.
8284
$pname = Creator::fill_type_name(undef, $pname, $def);
8385
push(@lines, "project$parents {");
86+
$pline = $def;
8487
}
8588
elsif ($line =~ /^(shared|static)name\s*=\s*(.+)$/) {
8689
## Add in the libs and after settings.
@@ -95,10 +98,15 @@ sub gather_info {
9598
}
9699
close($fh);
97100

98-
## Only return the lines if there is more than one line. It is
99-
## possible (and likely) that we've read in the project declaration,
100-
## but the project did not contain a sharedname or staticname
101-
## setting.
101+
## If we have the unmodified project name, but the user did not provide
102+
## a sharedname or staticname, we will use that as the library name.
103+
if (defined $pline && $#lines == 0) {
104+
push(@lines, " libs += $pline",
105+
" after += $pname",
106+
"}");
107+
}
108+
109+
## Only return the lines if there is more than one line.
102110
return @lines if ($#lines > 0);
103111
}
104112

@@ -148,9 +156,7 @@ sub usageAndExit {
148156
print STDERR "Create Base Project v$version\n",
149157
"Usage: ", basename($0), " <mpc files> <output file or ",
150158
"directory>\n\nThis script will create a base project ",
151-
"based on the contents of the\nsupplied MPC file. ",
152-
"This is only useful if the project ",
153-
"explicitly sets\nsharedname or staticname.\n";
159+
"based on the contents of the\nsupplied MPC file.\n";
154160
exit(0);
155161
}
156162

modules/CommandHelper.pm

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ sub get {
5151
## create a singleton of that type and return it.
5252
foreach my $inc (@INC) {
5353
if (-r "$inc/$type.pm") {
54+
OutputMessage::debug(undef, "Found $type.pm in $inc");
5455
require "$type.pm";
5556
$required{$type} = $type->new();
5657
return $required{$type};

modules/MakeWorkspaceCreator.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sub write_project_targets {
3838
my $chdir = ($dname ne '.');
3939
print $fh "\t\@",
4040
($chdir ? "cd $dname && " : ''),
41-
"\$(MAKE) -f ",
41+
'"$(MAKE)" -f ',
4242
($chdir ? $self->mpc_basename($project) : $project),
4343
" $target$crlf";
4444
}

modules/ProjectCreator.pm

+76-28
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ my $cppresource = 'resource_files';
194194
my %cppvc = ('source_files' => [ "\\.cpp", "\\.cxx", "\\.cc", "\\.c", "\\.C", ],
195195
'template_files' => [ "_T\\.cpp", "_T\\.cxx", "_T\\.cc", "_T\\.c", "_T\\.C", "_t\\.cpp", "_t\\.cxx", "_t\\.cc", "_t\\.c", "_t\\.C", "\\.tpp" ],
196196
'header_files' => [ "\\.h", "\\.hpp", "\\.hxx", "\\.hh", ],
197-
'inline_files' => [ "\\.i", "\\.ipp", "\\.inl", ],
197+
'inline_files' => [ "\\.i", "\\.ipp", "\\.ixx", "\\.inl", ],
198198
'documentation_files' => [ "README", "readme", "\\.doc", "\\.txt", "\\.html" ],
199199
$cppresource => [ "\\.rc", ],
200200
);
@@ -1386,7 +1386,6 @@ sub process_component_line {
13861386
$key =~ s/\\/\//g if ($self->{'convert_slashes'});
13871387
my $cmdflags = $$flags{'commandflags'};
13881388
my($add_out, $deps) = $cmdHelper->get_output($key, $cmdflags);
1389-
13901389
push(@{$self->{'custom_special_output'}->{$tag}->{$key}}, @$add_out);
13911390
foreach my $depTag (keys %$deps) {
13921391
foreach my $depFile (keys %{$deps->{$depTag}}) {
@@ -3183,10 +3182,9 @@ sub correct_generated_files {
31833182
sub generate_default_components {
31843183
my($self, $files, $passed) = @_;
31853184
my $genext = $self->{'generated_exts'};
3186-
my @gc = reverse sort { $self->sort_generated_types($a, $b)
3187-
} keys %$genext;
31883185
my @tags = (defined $passed ? $passed :
3189-
(@gc, keys %{$language{$self->get_language()}->[0]}));
3186+
($self->get_generated_components(),
3187+
keys %{$language{$self->get_language()}->[0]}));
31903188
my $pchh = $self->get_assignment('pch_header');
31913189
my $pchc = $self->get_assignment('pch_source');
31923190
my $recurse = $self->get_assignment('recurse');
@@ -3195,11 +3193,9 @@ sub generate_default_components {
31953193
my $cmdflags = 'commandflags';
31963194

31973195
## The order of @tags does make a difference in the way that generated
3198-
## files get added. Hence the sort call on the generate_exts keys to
3199-
## ensure that user defined types come first. They are reverse sorted
3200-
## using the custom sort function to ensure that user defined types
3201-
## that rely on other user defined types for input files are processed
3202-
## first.
3196+
## files get added. The function that returns the generated components
3197+
## sorts the tags such that user defined types that rely on other user
3198+
## defined types for input files are processed first.
32033199
foreach my $tag (@tags) {
32043200
if (!defined $genext->{$tag} ||
32053201
$genext->{$tag}->{'automatic_in'}) {
@@ -3688,27 +3684,80 @@ sub remove_excluded {
36883684
}
36893685

36903686

3691-
sub sort_generated_types {
3692-
## We need to sort the custom component types such that a custom type
3693-
## that generates input for another custom type comes first in the
3694-
## list.
3695-
my($self, $left, $right, $norecurse) = @_;
3696-
foreach my $key (keys %{$self->{'generated_exts'}->{$left}}) {
3687+
sub get_outputexts {
3688+
my($self, $type) = @_;
3689+
my @outputexts;
3690+
3691+
## Get all generated output extensions for this generated type.
3692+
foreach my $key (keys %{$self->{'generated_exts'}->{$type}}) {
36973693
if ($key =~ /_files$/) {
3698-
foreach my $regex (@{$self->{'generated_exts'}->{$left}->{$key}}) {
3699-
my $ext = $regex;
3700-
$ext =~ s/\\//g;
3701-
foreach my $vreg (@{$self->{'valid_components'}->{$right}}) {
3702-
return -1 if ($ext =~ /$vreg$/);
3694+
push(@outputexts, @{$self->{'generated_exts'}->{$type}->{$key}});
3695+
}
3696+
}
3697+
3698+
## If the generated type has a helper, get it and add the output exstensions
3699+
## to the list.
3700+
my $cmdHelper = $self->find_command_helper($type);
3701+
push(@outputexts, @{$cmdHelper->get_outputexts()}) if (defined $cmdHelper);
3702+
3703+
return \@outputexts;
3704+
}
3705+
3706+
sub get_generated_components {
3707+
my $self = shift;
3708+
my @list = keys %{$self->{'generated_exts'}};
3709+
my $len = scalar(@list);
3710+
my %geninfo;
3711+
my %movedfor;
3712+
for(my $i = 1; $i < $len; $i++) {
3713+
my $right = $list[$i];
3714+
3715+
## Cache the outputexts into a hash map so that we do not have to call a
3716+
## function more than once per type. Since items in the list will be
3717+
## swapped and $i modified, we are very likely to hit this cache multiple
3718+
## times.
3719+
my $outputexts;
3720+
if (exists $geninfo{$right}) {
3721+
$outputexts = $geninfo{$right};
3722+
}
3723+
else {
3724+
$geninfo{$right} = $outputexts = $self->get_outputexts($right);
3725+
}
3726+
3727+
## Go backwards in the list to see if $right will generate inputs for
3728+
## anything to the left.
3729+
for(my $j = $i - 1; $j >= 0; $j--) {
3730+
my $left = $list[$j];
3731+
## See if $right generates input for $left
3732+
my $generates;
3733+
foreach my $inputext (@{$self->{'valid_components'}->{$left}}) {
3734+
if (grep { $_ eq $inputext } @$outputexts) {
3735+
$generates = 1;
3736+
last;
37033737
}
37043738
}
3739+
3740+
if ($generates) {
3741+
## If it does and we haven't already moved $right because of $left,
3742+
## then we will move $right in front of $left, push everything to the
3743+
## right up to $i, and reset $i to $j (after the increment of the outer
3744+
## for loop).
3745+
if (exists $movedfor{$right} && $movedfor{$right} eq $left) {
3746+
$self->warning("Circular generation dependency for $right and $left");
3747+
}
3748+
else {
3749+
$movedfor{$right} = $left;
3750+
for(my $k = $i; $k > $j; $k--) {
3751+
$list[$k] = $list[$k - 1];
3752+
}
3753+
$list[$j] = $right;
3754+
$i = $j - 1;
3755+
}
3756+
last;
3757+
}
37053758
}
37063759
}
3707-
if (!$norecurse && $self->sort_generated_types($right, $left, 1) == -1) {
3708-
return 1;
3709-
}
3710-
3711-
return 0;
3760+
return @list;
37123761
}
37133762

37143763
sub generate_defaults {
@@ -3747,8 +3796,7 @@ sub generate_defaults {
37473796
my @vc = sort { return -1 if $a eq 'source_files';
37483797
return 1 if $b eq 'source_files';
37493798
return $b cmp $a; } keys %{$self->{'valid_components'}};
3750-
my @gvc = sort { $self->sort_generated_types($a, $b)
3751-
} keys %{$self->{'generated_exts'}};
3799+
my @gvc = $self->get_generated_components();
37523800
foreach my $gentype (@gvc) {
37533801
$self->list_default_generated($gentype, \@vc);
37543802
}

modules/WorkspaceCreator.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,8 @@ sub generate_project_files_fork {
18021802
}
18031803

18041804
$self->{'cacheok'} = $cacheok;
1805-
if ($self->cd($dir)) {
1805+
my $full = $self->path_is_relative($dir) ? "$cwd/$dir" : $dir;
1806+
if ($self->cd($full)) {
18061807
if ($self->{'cacheok'} && defined $allprojects{$prkey}) {
18071808

18081809
$files_written = $allprojects{$prkey};
@@ -1840,8 +1841,7 @@ sub generate_project_files_fork {
18401841
## Unable to change to the directory.
18411842
## We don't restore the state before we leave,
18421843
## but that's ok since we will be exiting soon.
1843-
return 0, $creator, $msg;
1844-
1844+
return 0, $creator, "Unable to change directory to $full";
18451845
}
18461846

18471847
## Return things to the way they were

0 commit comments

Comments
 (0)