syncqt: make it possible to declare particular headers being private

following the same mechanism as qpa headers, one can specify a list of
regexes in the @private_headers variable in sync.profile.

Change-Id: I5de0284e639ad283561f54dba7dda8c6437b23f8
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Oswald Buddenhagen 2018-06-20 14:19:21 +02:00
parent 372b5504fd
commit 8e075dac8f

View File

@ -84,7 +84,7 @@ $INPUT_RECORD_SEPARATOR = "\r\n" if ($^O eq "msys");
# will be defined based on the modules sync.profile
our (%modules, %moduleheaders, @allmoduleheadersprivate, %classnames, %deprecatedheaders);
our @qpa_headers = ();
our (@qpa_headers, @private_headers);
# will be derived from sync.profile
our %reverse_classnames = ();
@ -659,6 +659,8 @@ sub loadSyncProfile {
$reverse_classnames{$cn} = $fn;
}
}
push @private_headers, qr/_p(ch)?\.h$/;
}
sub basePrettify {
@ -701,6 +703,15 @@ sub isQpaHeader
return 0;
}
sub isPrivateHeader
{
my ($header) = @_;
foreach my $private_header (@private_headers) {
return 1 if ($header =~ $private_header);
}
return 0;
}
sub globosort($$) {
my ($a, $b) = @_;
if ($a =~ /^q(.*)global\.h$/) {
@ -1021,7 +1032,7 @@ foreach my $lib (@modules_to_sync) {
if(isQpaHeader($public_header)) {
$public_header = 0;
$qpa_header = 1;
} elsif ($allheadersprivate || $thisprivate || $public_header =~ /_p(ch)?\.h$/) {
} elsif ($allheadersprivate || $thisprivate || isPrivateHeader($public_header)) {
$public_header = 0;
}