Skip to content

Commit

Permalink
no rebuild opencv_wrapper on constlist update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Dec 31, 2022
1 parent 292012a commit 7aeb323
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ our @cw_objs = map $_.'$(OBJ_EXT)', qw(opencv_wrapper);
},
MYEXTLIB => join(' ', @cw_objs),
depend => {
'opencv_wrapper$(OBJ_EXT) $(OBJECT)'=>'opencv_wrapper.h wraplocal.h',
'$(OBJECT)'=>'opencv_wrapper.h wraplocal.h',
'opencv_wrapper$(OBJ_EXT)'=>'opencv_wrapper.h',
'wraplocal.h opencv_wrapper.h OpenCV.pm'=>'funclist.pl genpp.pl', # .pm because that deps on .pd
'OpenCV.c'=>'typemap',
'$(FIRST_MAKEFILE)'=>'submodmf.pl',
Expand Down Expand Up @@ -78,8 +79,10 @@ sub cpp_build {
}
sub MY::postamble {
my ($self) = @_;
my $const = -f 'constlist.txt' ? 'wraplocal.h : constlist.txt' : '';
join "\n", pdlpp_postamble($package),
genwrap_from('opencv_wrapper', 0, ','),
genwrap_from('wraplocal', 0, ','),
$const,
cpp_build($self, qw(opencv_wrapper wraplocal));
}
4 changes: 3 additions & 1 deletion submodmf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ sub wmf {
$hash{OBJECT} .= join ' ', '', map $_.'$(OBJ_EXT)', qw(wraplocal);
$hash{depend} = {
'$(OBJECT)'=>catfile(updir, 'opencv_wrapper.h') . ' wraplocal.h',
"$last.pm wraplocal.h"=>join(' ', catfile(updir, 'genpp.pl'), 'funclist.pl', (!-f 'constlist.txt' ? () : ('constlist.txt'))),
"$last.pm wraplocal.h"=>join(' ', catfile(updir, 'genpp.pl'), 'funclist.pl'),
"$last.c"=>catfile(updir, 'typemap'),
};
$hash{LDFROM} .= join ' ', '', '$(OBJECT)', map catfile(updir, $_), @cw_objs;
Expand All @@ -27,8 +27,10 @@ sub wmf {
undef &MY::postamble;
*MY::postamble = sub {
my ($self) = @_;
my $const = -f 'constlist.txt' ? 'wraplocal.h : constlist.txt' : '';
join "\n", pdlpp_postamble($package),
genwrap_from('wraplocal', 1, join(',', '', @$hdrs), @$classes),
$const,
cpp_build($self, 'wraplocal');
};
WriteMakefile(%hash);
Expand Down

0 comments on commit 7aeb323

Please sign in to comment.