make a proper header-only module for QtZlib

that way other modules can use the headers without hacks.

this required making the base directory for paths in headers.pri
configurable in syncqt.

Change-Id: Id35cfe05bcf4c576d3f2d0d8d09590a5e23d21d3
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
This commit is contained in:
Oswald Buddenhagen 2015-11-10 18:40:04 +01:00
parent 3d3b4129cd
commit ded63fbb94
7 changed files with 17 additions and 11 deletions

View File

@ -812,6 +812,7 @@ foreach my $lib (@modules_to_sync) {
my $is_qt = !($module =~ s/^!//);
my @dirs = split(/;/, $module);
my $dir = $dirs[0];
shift @dirs if ($dir =~ s/^>//);
my $pathtoheaders = "";
$pathtoheaders = $moduleheaders{$lib} if ($moduleheaders{$lib});

View File

@ -38,6 +38,9 @@ git_build: \
else: \
INC_PATH = $$MODULE_BASE_INDIR
include($$INC_PATH/include/$$MODULE_INCNAME/headers.pri, "", true)
CONFIG += qt_install_headers
alien_syncqt: return()
for (injection, SYNCQT.INJECTIONS) {
injects = $$split(injection, :)
@ -82,8 +85,6 @@ SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER
isEmpty(PRECOMPILED_HEADER): PRECOMPILED_HEADER = $$MODULE_MASTER_DEPS_HEADER
}
CONFIG += qt_install_headers
headersclean:!internal_module {
# Make sure that the header compiles with our strict options
hcleanDEFS = -DQT_NO_CAST_TO_ASCII=1 \

7
src/corelib/qtzlib.pro Normal file
View File

@ -0,0 +1,7 @@
TARGET = QtZlib
MODULE = zlib
MAKEFILE = Makefile.qtzlib
CONFIG += internal_module header_module alien_syncqt
QT =
load(qt_module)

View File

@ -155,10 +155,6 @@ else:SOURCES += tools/qelapsedtimer_generic.cpp
contains(QT_CONFIG, zlib) {
include($$PWD/../../3rdparty/zlib.pri)
corelib_zlib_headers.files = $$PWD/../../3rdparty/zlib/zconf.h\
$$PWD/../../3rdparty/zlib/zlib.h
corelib_zlib_headers.path = $$[QT_INSTALL_HEADERS]/QtZlib
INSTALLS += corelib_zlib_headers
} else {
include($$PWD/../../3rdparty/zlib_dependency.pri)
}

View File

@ -2,6 +2,9 @@ TEMPLATE = subdirs
load(qfeatures)
src_qtzlib.file = $$PWD/corelib/qtzlib.pro
src_qtzlib.target = sub-zlib
src_tools_bootstrap.subdir = tools/bootstrap
src_tools_bootstrap.target = sub-bootstrap
src_tools_bootstrap.CONFIG = host_build
@ -125,6 +128,7 @@ src_plugins.depends = src_sql src_xml src_network
src_android.subdir = $$PWD/android
# this order is important
contains(QT_CONFIG, zlib)|cross_compile: SUBDIRS += src_qtzlib
SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc
!contains(QT_DISABLED_FEATURES, regularexpression):pcre {
SUBDIRS += src_3rdparty_pcre

View File

@ -39,10 +39,7 @@ MODULE_PRIVATE_INCLUDES = \
# We need the forwarding headers before their respective modules are built,
# so do a minimal syncqt run.
CONFIG += minimal_syncqt
QMAKE_SYNCQT_OPTIONS = -module QtCore -module QtDBus -module QtXml
contains(QT_CONFIG, zlib): \
QMAKE_SYNCQT_OPTIONS += -module QtZlib
QMAKE_SYNCQT_OPTIONS += -version $$QT_VERSION
QMAKE_SYNCQT_OPTIONS = -module QtCore -module QtDBus -module QtXml -version $$QT_VERSION
load(qt_module)

View File

@ -16,7 +16,7 @@
"QtANGLE/GLES2" => "!$basedir/src/3rdparty/angle/include/GLES2",
"QtANGLE/GLES3" => "!$basedir/src/3rdparty/angle/include/GLES3",
"QtANGLE/EGL" => "!$basedir/src/3rdparty/angle/include/EGL",
"QtZlib" => "!$basedir/src/3rdparty/zlib",
"QtZlib" => "!>$basedir/src/corelib;$basedir/src/3rdparty/zlib",
"QtOpenGLExtensions" => "$basedir/src/openglextensions",
);
%moduleheaders = ( # restrict the module headers to those found in relative path