diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-06-03 15:44:40 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2010-06-04 13:12:42 +0200 |
commit | 24e198c15a807d4829d0f25d9169b8e188d57321 (patch) | |
tree | 5cff230fe34c4d124374350e683bd871c6643151 | |
parent | afdda55661ddf4e054624567e6d7ef2481d3998c (diff) |
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
-rwxr-xr-x | bin/syncqt | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/bin/syncqt b/bin/syncqt index d4a2a7c5d2..2c98b5416c 100755 --- a/bin/syncqt +++ b/bin/syncqt @@ -673,6 +673,7 @@ $isunix = checkUnix; #cache checkUnix # create path mkpath "$out_basedir/include", 0777; +mkpath "$out_basedir/include/Qt", 0777; my @ignore_headers = (); my $class_lib_map_contents = ""; @@ -681,6 +682,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{QtAssistant}", "$modules{QtDesigner}", "$modules{QtUiTools}", "$modules{QtDBus}", "$modules{phonon}" ); +my %colliding_headers = (); foreach (@modules_to_sync) { #iteration info @@ -820,8 +822,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); @@ -841,8 +865,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)); |