diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-05-28 20:57:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-03 17:59:42 +0200 |
commit | 96557bc389794abdcb15305c2a439f344ec2f0c3 (patch) | |
tree | 61adec31a54efc274ef5eb7e9e6290a6ee759361 /bin | |
parent | 0519129c5977280dfa2f8a47ca4aa93fe9fee84b (diff) |
move module master header generation back to syncqt
now that we split out the part that depends on the project file, we can
do it cleanly here.
this way we can generate these headers at pre-build time already.
and for git builds, perl is probably faster than qmake at this task.
Change-Id: I343255c6de22329471a3ae2c2aac9ebeb160a501
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/syncqt.pl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bin/syncqt.pl b/bin/syncqt.pl index 1da3878695..497e8deb2c 100755 --- a/bin/syncqt.pl +++ b/bin/syncqt.pl @@ -172,6 +172,30 @@ sub checkRelative { } ###################################################################### +# Syntax: shouldMasterInclude(iheader) +# Params: iheader, string, filename to verify inclusion +# +# Purpose: Determines if header should be in the master include file. +# Returns: 0 if file contains "#pragma qt_no_master_include" or not +# able to open, else 1. +###################################################################### +sub shouldMasterInclude { + my ($iheader) = @_; + return 0 if (basename($iheader) =~ /_/); + return 0 if (basename($iheader) =~ /qconfig/); + if (open(F, "<$iheader")) { + while (<F>) { + chomp; + return 0 if (/^\#pragma qt_no_master_include$/); + } + close(F); + } else { + return 0; + } + return 1; +} + +###################################################################### # Syntax: classNames(iheader) # Params: iheader, string, filename to parse for classname "symlinks" # @@ -828,6 +852,12 @@ foreach my $lib (@modules_to_sync) { my $pri_install_pfiles = ""; my $pri_install_qpafiles = ""; + my $libcapitals = uc($lib); + my $master_contents = + "#ifndef QT_".$libcapitals."_MODULE_H\n" . + "#define QT_".$libcapitals."_MODULE_H\n" . + "#include <$lib/${lib}Depends>\n"; + #remove the old files if($remove_stale) { my %injections = (); @@ -960,6 +990,9 @@ foreach my $lib (@modules_to_sync) { } if($public_header) { + #put it into the master file + $master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader)); + #deal with the install directives if($public_header) { my $pri_install_iheader = fixPaths($iheader, $dir); @@ -1018,6 +1051,11 @@ foreach my $lib (@modules_to_sync) { } } + # close the master include: + $master_contents .= + "#include \"".lc($lib)."version.h\"\n" . + "#endif\n"; + unless ($showonly || $minimal) { # create deprecated headers my $first = 1; @@ -1100,6 +1138,10 @@ foreach my $lib (@modules_to_sync) { "#endif // QT_".uc($lib)."_VERSION_H\n"; writeFile($vheader, $vhdrcont, $lib, "version header"); + my $master_include = "$out_basedir/include/$lib/$lib"; + $pri_install_files .= fixPaths($master_include, $dir) . " "; + writeFile($master_include, $master_contents, $lib, "master header"); + #handle the headers.pri for each module my $headers_pri_contents = ""; $headers_pri_contents .= "SYNCQT.HEADER_FILES = $pri_install_files\n"; |