summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.tests/xkbcommon/main.cpp58
-rw-r--r--config.tests/xkbcommon/xkbcommon.pro17
-rw-r--r--qtwayland.pro26
-rw-r--r--src/compositor/compositor.pri33
-rw-r--r--src/plugins/platforms/wayland/wayland.pro59
-rw-r--r--sync.profile5
-rw-r--r--tests/auto/client/client.pro35
-rw-r--r--tests/auto/compositor/compositor.pro26
8 files changed, 198 insertions, 61 deletions
diff --git a/config.tests/xkbcommon/main.cpp b/config.tests/xkbcommon/main.cpp
new file mode 100644
index 00000000..9f10f3ea
--- /dev/null
+++ b/config.tests/xkbcommon/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <X11/extensions/XKBcommon.h>
+#include <X11/keysym.h>
+
+#include <QtCore/qnamespace.h>
+
+int main(int argc, char **argv)
+{
+ struct xkb_rule_names names;
+ names.rules = "evdev";
+ names.model = "pc105";
+ names.layout = "us";
+ names.variant = "";
+ names.options = "";
+
+ struct xkb_desc *xkb = xkb_compile_keymap_from_rules(&names);
+ Q_UNUSED(xkb);
+ return 0;
+}
diff --git a/config.tests/xkbcommon/xkbcommon.pro b/config.tests/xkbcommon/xkbcommon.pro
new file mode 100644
index 00000000..facc28e5
--- /dev/null
+++ b/config.tests/xkbcommon/xkbcommon.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = xkbcommon
+QT = core
+DEPENDPATH += .
+INCLUDEPATH += .
+
+!contains(QT_CONFIG, no-pkg-config) {
+ QMAKE_CFLAGS_XKBCOMMON=$$system(pkg-config --cflags xkbcommon 2>/dev/null)
+ QMAKE_LIBS_XKBCOMMON=$$system(pkg-config --libs xkbcommon 2>/dev/null)
+}
+
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+LIBS += $$QMAKE_LIBS_XKBCOMMON
+
+# Input
+SOURCES += main.cpp
diff --git a/qtwayland.pro b/qtwayland.pro
index 07dea21a..377ee24f 100644
--- a/qtwayland.pro
+++ b/qtwayland.pro
@@ -1,15 +1,23 @@
TEMPLATE=subdirs
+CONFIG += ordered
-module_qtcompositor_src.subdir = src
-module_qtcompositor_src.target = module-module_qtcompositor_src
+module_qtwayland_src.subdir = src
+module_qtwayland_src.target = module-qtwayland-src
-module_qtcompositor_examples.subdir = examples
-module_qtcompositor_examples.target = module_qtcompositor_examples
-module_qtcompositor_examples.depends = module_qtcompositor_src
+module_qtwayland_examples.subdir = examples
+module_qtwayland_examples.target = module-qtwayland-examples
+module_qtwayland_examples.depends = module_qtwayland_src
!contains(QT_BUILD_PARTS,examples) {
- module_qtcompositor_examples.CONFIG = no_default_target no_default_install
+ module_qtwayland_examples.CONFIG = no_default_target no_default_install
}
-SUBDIRS += tests \
- module_qtcompositor_src \
- module_qtcompositor_examples \
+module_qtwayland_tests.subdir = tests
+module_qtwayland_tests.target = module-qtwayland-tests
+module_qtwayland_tests.depends = module_qtwayland_src
+!contains(QT_BUILD_PARTS,tests):!with-tests {
+ module_qtwayland_tests.CONFIG += no_default_target
+}
+
+SUBDIRS += module_qtwayland_src \
+ module_qtwayland_examples \
+ module_qtwayland_tests
diff --git a/src/compositor/compositor.pri b/src/compositor/compositor.pri
index 7962b05b..77467c2d 100644
--- a/src/compositor/compositor.pri
+++ b/src/compositor/compositor.pri
@@ -7,24 +7,27 @@ INCLUDEPATH += $$PWD
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
DEFINES += QT_BUILD_COMPOSITOR_LIB
-!mac:use_pkgconfig {
- CONFIG += link_pkgconfig
- PKGCONFIG += wayland-server
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-server 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-server 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
- #set the rpath
- !isEmpty(QMAKE_LFLAGS_RPATH) {
- WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
- !isEmpty(WAYLAND_NEEDS_RPATH) {
- WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
- !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
- }
- }
-} else {
- INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
!isEmpty(QMAKE_LIBDIR_WAYLAND) {
- LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
}
- LIBS += -lwayland-server -lffi
}
HEADERS += qtcompositorversion.h
diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro
index 9d43c877..73909bf6 100644
--- a/src/plugins/platforms/wayland/wayland.pro
+++ b/src/plugins/platforms/wayland/wayland.pro
@@ -6,21 +6,8 @@ CONFIG += qpa/genericunixfontdatabase
DESTDIR = $$QT.gui.plugins/platforms
-DEFINES += Q_PLATFORM_WAYLAND
-DEFINES += $$QMAKE_DEFINES_WAYLAND
-
-mac {
- DEFINES += QT_NO_WAYLAND_XKB
-}
-
QT += core-private gui-private platformsupport-private
-WAYLANDSOURCES += \
- $$PWD/../../../../extensions/surface-extension.xml \
- $$PWD/../../../../extensions/sub-surface-extension.xml \
- $$PWD/../../../../extensions/output-extension.xml \
- $$PWD/../../../../extensions/touch-extension.xml
-
SOURCES = main.cpp \
qwaylandintegration.cpp \
qwaylandnativeinterface.cpp \
@@ -66,18 +53,54 @@ HEADERS = qwaylandintegration.h \
qwaylandtouch.h \
$$PWD/../../../shared/qwaylandmimehelper.h
+DEFINES += Q_PLATFORM_WAYLAND
+
+contains(config_test_xkbcommon,yes) {
+ !contains(QT_CONFIG, no-pkg-config) {
+ QMAKE_CFLAGS_XKBCOMMON=$$system(pkg-config --cflags xkbcommon 2>/dev/null)
+ QMAKE_LIBS_XKBCOMMON=$$system(pkg-config --libs xkbcommon 2>/dev/null)
+ }
+
+ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ LIBS += $$QMAKE_LIBS_XKBCOMMON
+} else {
+ DEFINES += QT_NO_WAYLAND_XKB
+}
+
+WAYLANDSOURCES += \
+ $$PWD/../../../../extensions/surface-extension.xml \
+ $$PWD/../../../../extensions/sub-surface-extension.xml \
+ $$PWD/../../../../extensions/output-extension.xml \
+ $$PWD/../../../../extensions/touch-extension.xml
+
+
OTHER_FILES += wayland.json
INCLUDEPATH += $$PWD/../../../shared
-INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
-
-LIBS += $$QMAKE_LIBS_WAYLAND
-mac {
- LIBS += -lwayland-client
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-client 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-client 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
}
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
+ !isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
+ }
+}
target.path += $$[QT_INSTALL_PLUGINS]/platforms
INSTALLS += target
diff --git a/sync.profile b/sync.profile
index 27887ee8..e964999d 100644
--- a/sync.profile
+++ b/sync.profile
@@ -22,3 +22,8 @@
%dependencies = (
"qtbase" => "refs/heads/master",
);
+
+# Compile tests
+%configtests = (
+ "xkbcommon" => {}
+);
diff --git a/tests/auto/client/client.pro b/tests/auto/client/client.pro
index 12dad355..6bfe82b7 100644
--- a/tests/auto/client/client.pro
+++ b/tests/auto/client/client.pro
@@ -4,24 +4,29 @@ TARGET = tst_client
QT += testlib
QT += core-private gui-private
-use_pkgconfig {
- CONFIG += link_pkgconfig
- PKGCONFIG += wayland-server
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-client 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-client 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
- #set the rpath
- !isEmpty(QMAKE_LFLAGS_RPATH) {
- WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
- !isEmpty(WAYLAND_NEEDS_RPATH) {
- WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
- !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
- }
- }
-} else {
- INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
!isEmpty(QMAKE_LIBDIR_WAYLAND) {
- LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
}
- LIBS += -lwayland-server -lffi
}
SOURCES += tst_client.cpp \
diff --git a/tests/auto/compositor/compositor.pro b/tests/auto/compositor/compositor.pro
index 26a3cb8a..68524f6c 100644
--- a/tests/auto/compositor/compositor.pro
+++ b/tests/auto/compositor/compositor.pro
@@ -4,11 +4,29 @@ TARGET = tst_compositor
QT += testlib
QT += core-private gui-private compositor
-INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-server 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-server 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
+
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
-LIBS += $$QMAKE_LIBS_WAYLAND
-mac {
- LIBS += -lwayland-client
+!isEmpty(QMAKE_LFLAGS_RPATH) {
+ !isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
+ }
}
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND