automate handling of generated headers some more
let the syncqt + qt_module_header.prf pair handle generation of forwarding headers. in qtbase this is ineffective to some degree, as the need to create QtCore's forwarding headers early for QtBootstrap requires qtbase.pro already doing the real work, but at least we get the verification that nothing breaks. Other Modules (TM) will need the full functionality. Change-Id: Ifd3dfa05c4c8a91698a365160edb6dabc84e553f Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
13455344d7
commit
f8c5dd9857
@ -833,6 +833,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
my $pri_install_files = "";
|
my $pri_install_files = "";
|
||||||
my $pri_install_pfiles = "";
|
my $pri_install_pfiles = "";
|
||||||
my $pri_install_qpafiles = "";
|
my $pri_install_qpafiles = "";
|
||||||
|
my $pri_injections = "";
|
||||||
|
|
||||||
my $libcapitals = uc($lib);
|
my $libcapitals = uc($lib);
|
||||||
my $master_contents =
|
my $master_contents =
|
||||||
@ -905,8 +906,15 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
#calc files and "copy" them
|
#calc files and "copy" them
|
||||||
foreach my $subdir (@subdirs) {
|
foreach my $subdir (@subdirs) {
|
||||||
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
|
my @headers = findFiles($subdir, "^[-a-z0-9_]*\\.h\$" , 0);
|
||||||
|
if (defined $inject_headers{$subdir}) {
|
||||||
|
foreach my $if (@{$inject_headers{$subdir}}) {
|
||||||
|
@headers = grep(!/^\Q$if\E$/, @headers); #in case we configure'd previously
|
||||||
|
push @headers, "*".$if;
|
||||||
|
}
|
||||||
|
}
|
||||||
my $header_dirname = "";
|
my $header_dirname = "";
|
||||||
foreach my $header (@headers) {
|
foreach my $header (@headers) {
|
||||||
|
my $shadow = ($header =~ s/^\*//);
|
||||||
$header = 0 if($header =~ /^ui_.*.h/);
|
$header = 0 if($header =~ /^ui_.*.h/);
|
||||||
foreach (@ignore_headers) {
|
foreach (@ignore_headers) {
|
||||||
$header = 0 if($header eq $_);
|
$header = 0 if($header eq $_);
|
||||||
@ -928,6 +936,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $iheader = $subdir . "/" . $header;
|
my $iheader = $subdir . "/" . $header;
|
||||||
|
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
|
||||||
my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : ();
|
my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : ();
|
||||||
if($showonly) {
|
if($showonly) {
|
||||||
print "$header [$lib]\n";
|
print "$header [$lib]\n";
|
||||||
@ -935,7 +944,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
print "SYMBOL: $_\n";
|
print "SYMBOL: $_\n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
my $ts = (stat($iheader))[9];
|
my $ts = $shadow ? 0 : (stat($iheader))[9];
|
||||||
#find out all the places it goes..
|
#find out all the places it goes..
|
||||||
my $oheader;
|
my $oheader;
|
||||||
if ($public_header) {
|
if ($public_header) {
|
||||||
@ -949,19 +958,20 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
# class =~ s,::,/,g;
|
# class =~ s,::,/,g;
|
||||||
# }
|
# }
|
||||||
|
|
||||||
$header_copies++ if (syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts));
|
$header_copies++ if (!$shadow && syncHeader($lib, "$out_basedir/include/$lib/$class", "$out_basedir/include/$lib/$header", 0, $ts));
|
||||||
}
|
}
|
||||||
} elsif ($create_private_headers && !$qpa_header) {
|
} elsif ($create_private_headers && !$qpa_header) {
|
||||||
$oheader = "$out_basedir/include/$lib/$module_version/$lib/private/$header";
|
$oheader = "$out_basedir/include/$lib/$module_version/$lib/private/$header";
|
||||||
} elsif ($create_private_headers) {
|
} elsif ($create_private_headers) {
|
||||||
$oheader = "$out_basedir/include/$lib/$module_version/$lib/qpa/$header";
|
$oheader = "$out_basedir/include/$lib/$module_version/$lib/qpa/$header";
|
||||||
}
|
}
|
||||||
$header_copies++ if (syncHeader($lib, $oheader, $iheader, $copy_headers, $ts));
|
$header_copies++ if (!$shadow && syncHeader($lib, $oheader, $iheader, $copy_headers, $ts));
|
||||||
|
|
||||||
my $pri_install_iheader = fixPaths($iheader, $dir);
|
my $pri_install_iheader = fixPaths($iheader, $dir);
|
||||||
|
my $injection = "";
|
||||||
if($public_header) {
|
if($public_header) {
|
||||||
#put it into the master file
|
#put it into the master file
|
||||||
$master_contents .= "#include \"$public_header\"\n" if (shouldMasterInclude($iheader));
|
$master_contents .= "#include \"$public_header\"\n" if (!$shadow && shouldMasterInclude($iheader));
|
||||||
|
|
||||||
#deal with the install directives
|
#deal with the install directives
|
||||||
foreach my $class (@classes) {
|
foreach my $class (@classes) {
|
||||||
@ -973,6 +983,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
my $class_header = fixPaths("$out_basedir/include/$lib/$class", $dir) . " ";
|
my $class_header = fixPaths("$out_basedir/include/$lib/$class", $dir) . " ";
|
||||||
$pri_install_classes .= $class_header
|
$pri_install_classes .= $class_header
|
||||||
unless($pri_install_classes =~ $class_header);
|
unless($pri_install_classes =~ $class_header);
|
||||||
|
$injection .= ":$class";
|
||||||
}
|
}
|
||||||
$pri_install_files.= "$pri_install_iheader ";;
|
$pri_install_files.= "$pri_install_iheader ";;
|
||||||
}
|
}
|
||||||
@ -982,6 +993,9 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
else {
|
else {
|
||||||
$pri_install_pfiles.= "$pri_install_iheader ";;
|
$pri_install_pfiles.= "$pri_install_iheader ";;
|
||||||
}
|
}
|
||||||
|
$pri_injections .= fixPaths($iheader, "$out_basedir/include/$lib")
|
||||||
|
.":".fixPaths($oheader, "$out_basedir/include/$lib")
|
||||||
|
.$injection." " if ($shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($verbose_level && $header_copies) {
|
if ($verbose_level && $header_copies) {
|
||||||
@ -1112,6 +1126,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
$headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n";
|
$headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n";
|
||||||
$headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n";
|
$headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n";
|
||||||
$headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n";
|
$headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n";
|
||||||
|
$headers_pri_contents .= "SYNCQT.INJECTIONS = $pri_injections\n";
|
||||||
my $headers_pri_file = "$out_basedir/include/$lib/headers.pri";
|
my $headers_pri_file = "$out_basedir/include/$lib/headers.pri";
|
||||||
writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file");
|
writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file");
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,20 @@ else: \
|
|||||||
INC_PATH = $$MODULE_BASE_INDIR
|
INC_PATH = $$MODULE_BASE_INDIR
|
||||||
include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true)
|
include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true)
|
||||||
|
|
||||||
|
for (injection, SYNCQT.INJECTIONS) {
|
||||||
|
injects = $$split(injection, :)
|
||||||
|
fwd_hdr = $$member(injects, 1)
|
||||||
|
MAIN_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$fwd_hdr
|
||||||
|
MAIN_FWD_CONT = '$${LITERAL_HASH}include "$$member(injects, 0)"'
|
||||||
|
write_file($$MAIN_FWD, MAIN_FWD_CONT)|error("Aborting.")
|
||||||
|
injects = $$member(injects, 2, -1)
|
||||||
|
for (inject, injects) {
|
||||||
|
CLASS_FWD = $$INC_PATH/include/$$MODULE_INCNAME/$$inject
|
||||||
|
CLASS_FWD_CONT = '$${LITERAL_HASH}include "$$fwd_hdr"'
|
||||||
|
write_file($$CLASS_FWD, CLASS_FWD_CONT)|error("Aborting.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
autogen_warning = \
|
autogen_warning = \
|
||||||
"/* This file was generated by qmake with the info from <root>/$$relative_path($$_PRO_FILE_, $$MODULE_BASE_INDIR). */"
|
"/* This file was generated by qmake with the info from <root>/$$relative_path($$_PRO_FILE_, $$MODULE_BASE_INDIR). */"
|
||||||
|
|
||||||
|
@ -29,15 +29,6 @@ SOURCES += \
|
|||||||
# qlibraryinfo.cpp includes qconfig.cpp
|
# qlibraryinfo.cpp includes qconfig.cpp
|
||||||
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
|
INCLUDEPATH += $$QT_BUILD_TREE/src/corelib/global
|
||||||
|
|
||||||
# configure creates these, not syncqt, so we need to manually inject them
|
|
||||||
qconfig_h_files = \
|
|
||||||
$$OUT_PWD/global/qfeatures.h \
|
|
||||||
$$OUT_PWD/global/qconfig.h \
|
|
||||||
$$QT_BUILD_TREE/include/QtCore/QtConfig
|
|
||||||
targ_headers.files += $$qconfig_h_files
|
|
||||||
contains(QMAKE_BUNDLE_DATA, FRAMEWORK_HEADERS): \
|
|
||||||
FRAMEWORK_HEADERS.files += $$qconfig_h_files
|
|
||||||
|
|
||||||
# Only used on platforms with CONFIG += precompile_header
|
# Only used on platforms with CONFIG += precompile_header
|
||||||
PRECOMPILED_HEADER = global/qt_pch.h
|
PRECOMPILED_HEADER = global/qt_pch.h
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
%classnames = (
|
%classnames = (
|
||||||
"qglobal.h" => "QtGlobal",
|
"qglobal.h" => "QtGlobal",
|
||||||
"qendian.h" => "QtEndian",
|
"qendian.h" => "QtEndian",
|
||||||
|
"qconfig.h" => "QtConfig",
|
||||||
"qplugin.h" => "QtPlugin",
|
"qplugin.h" => "QtPlugin",
|
||||||
"qalgorithms.h" => "QtAlgorithms",
|
"qalgorithms.h" => "QtAlgorithms",
|
||||||
"qcontainerfwd.h" => "QtContainerFwd",
|
"qcontainerfwd.h" => "QtContainerFwd",
|
||||||
|
Loading…
Reference in New Issue
Block a user