diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-06-03 13:44:40 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-06-08 16:23:45 (GMT) |
commit | a9b3381f4b42e1641834cbc1dfff4815b625807b (patch) | |
tree | 8291d86b819af6f1035cbc7cb1b6ffe7ce06dec6 /bin | |
parent | fb68f9975f801fb20ec4917dc7a980be2f162876 (diff) | |
download | Qt-a9b3381f4b42e1641834cbc1dfff4815b625807b.zip Qt-a9b3381f4b42e1641834cbc1dfff4815b625807b.tar.gz Qt-a9b3381f4b42e1641834cbc1dfff4815b625807b.tar.bz2 |
deprecate header files in $$QT_BUILD_TREE/include/Qt
To resolve the header file conflict as described in QTBUG-10647, we
* remove include/Qt/private
* "syncqt -copy" creates in include/Qt local forwarding headers
instead of header file copies
In case of a conflict, e.g. qxmlstream.h, we include both header files.
All header files in include/Qt now yield a preprocessor warning, if
they're included. They should not be used and will vanish some day.
Task-number: QTBUG-10647
Reviewed-by: ossi
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/syncqt | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -681,6 +681,7 @@ $isunix = checkUnix; #cache checkUnix # create path mkpath "$out_basedir/include", !$quiet; +mkpath "$out_basedir/include/Qt", !$quiet; my @ignore_headers = (); my $class_lib_map_contents = ""; @@ -689,6 +690,7 @@ my @ignore_for_include_check = ( "qatomic.h" ); my @ignore_for_qt_begin_header_check = ( "qiconset.h", "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qt_windows.h" ); my @ignore_for_qt_begin_namespace_check = ( "qconfig.h", "qconfig-dist.h", "qconfig-large.h", "qconfig-medium.h", "qconfig-minimal.h", "qconfig-small.h", "qfeatures.h", "qatomic_arch.h", "qatomic_windowsce.h", "qt_windows.h", "qatomic_macosx.h" ); my @ignore_for_qt_module_check = ( "$modules{QtCore}/arch", "$modules{QtCore}/global", "$modules{QtSql}/drivers", "$modules{QtTest}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); +my %colliding_headers = (); foreach (@modules_to_sync) { #iteration info @@ -828,8 +830,30 @@ foreach (@modules_to_sync) { my @headers; if ($public_header) { @headers = ( "$out_basedir/include/$lib/$header" ); - push @headers, "$out_basedir/include/Qt/$header" - if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/); + + # write forwarding headers to include/Qt + if ("$lib" ne "phonon" && "$subdir" =~ /^$basedir\/src/) { + my $file_name = "$out_basedir/include/Qt/$header"; + my $header_content = ''; + if (exists $colliding_headers{$file_name}) { + $file_name = ">>$file_name"; + } else { + $colliding_headers{$file_name} = 1; + $file_name = ">$file_name"; + my $warning_msg = 'Inclusion of header files from include/Qt is deprecated.'; + $header_content = "#ifndef QT_NO_QT_INCLUDE_WARN\n" . + " #if defined(__GNUC__)\n" . + " #pragma warning \"$warning_msg\"\n" . + " #elif defined(_MSC_VER)\n" . + " #pragma message \"WARNING: $warning_msg\"\n" . + " #endif\n". + "#endif\n\n"; + } + $header_content .= '#include "' . "../$lib/$header" . "\"\n"; + open HEADERFILE, $file_name; + print HEADERFILE $header_content; + close HEADERFILE; + } foreach(@classes) { my $header_base = basename($header); @@ -849,8 +873,6 @@ foreach (@modules_to_sync) { } } elsif ($create_private_headers) { @headers = ( "$out_basedir/include/$lib/private/$header" ); - push @headers, "$out_basedir/include/Qt/private/$header" - if ("$lib" ne "phonon"); } foreach(@headers) { #sync them $header_copies++ if(syncHeader($_, $iheader, $copy_headers)); |