diff options
author | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2017-11-27 12:46:47 -0800 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@qt.io> | 2017-12-01 01:19:46 +0000 |
commit | 32326a4b3b8234f56bb1c5f47b5bdd6c8fec7917 (patch) | |
tree | 46a0f2e1d9b1aaad0b1e533aab44bcf23ec01a18 | |
parent | 728c325a51d7e7863dc9bbffb730dfce11dc3d68 (diff) |
macx-clang: Opt-in xcb QPA support with XQuartz
Enable xcb QPA plugin when XQuartz is available. This is done
in a single build, alongside the Cocoa version.
We delegate part of the configuration stage to pkg-config, so
this becomes a requirement. Ensure that
PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig
is in your environment, or pkg-config is properly set up.
Tested with the following configure options:
configure \
-pkg-config \
-fontconfig -system-freetype \
-system-xcb -xkb -no-opengl \
-qt-xkbcommon -qt-xkbcommon-x11
Change-Id: I2eb5a0491172368afc4c629c540cbef08580348d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
-rw-r--r-- | mkspecs/macx-clang/qmake.conf | 19 | ||||
-rw-r--r-- | src/gui/configure.json | 10 | ||||
-rw-r--r-- | src/platformsupport/fontdatabases/fontdatabases.pro | 30 | ||||
-rw-r--r-- | src/platformsupport/platformsupport.pro | 2 | ||||
-rw-r--r-- | src/platformsupport/themes/themes.pro | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/xcb-plugin.pro | 2 | ||||
-rw-r--r-- | src/widgets/kernel/mac.pri | 2 |
7 files changed, 48 insertions, 19 deletions
diff --git a/mkspecs/macx-clang/qmake.conf b/mkspecs/macx-clang/qmake.conf index e34c08954d..259595221f 100644 --- a/mkspecs/macx-clang/qmake.conf +++ b/mkspecs/macx-clang/qmake.conf @@ -6,6 +6,25 @@ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.10 QMAKE_APPLE_DEVICE_ARCHS = x86_64 +# Opt-in xcb QPA support with XQuartz: +# +# configure \ +# -pkg-config \ +# -fontconfig -system-freetype \ +# -system-xcb -xkb -no-opengl \ +# -qt-xkbcommon -qt-xkbcommon-x11 +# +# Ensure that pkg-config is properly configured, or that +# PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig +# is set in your build environment. +# +# Due to irreconcilable differences between Cocoa +# and X11, OpenGL is currently not supported. + +QMAKE_LIBS_X11 = -lX11 -lXext -lm +QMAKE_LIBDIR_X11 = /opt/X11/lib +QMAKE_INCDIR_X11 = /opt/X11/include + include(../common/macx.conf) include(../common/gcc-base-mac.conf) include(../common/clang.conf) diff --git a/src/gui/configure.json b/src/gui/configure.json index 0a591e110c..a68f2eed16 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -928,7 +928,8 @@ }, "fontconfig": { "label": "Fontconfig", - "condition": "!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig", + "autoDetect": "!config.darwin", + "condition": "!config.win32 && features.system-freetype && libs.fontconfig", "output": [ "privateFeature", "feature" ] }, "gbm": { @@ -1501,6 +1502,13 @@ XKB configuration data. This is required for keyboard input support." }, { "type": "note", + "condition": "features.xcb && config.darwin", + "message": "XCB support on macOS is minimal and untested. Some features will +not work properly or at all (e.g. OpenGL, desktop services or accessibility), +or may depend on your system and XQuartz setup." + }, + { + "type": "note", "condition": "features.accessibility && features.xcb && !features.accessibility-atspi-bridge", "message": "Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing." }, diff --git a/src/platformsupport/fontdatabases/fontdatabases.pro b/src/platformsupport/fontdatabases/fontdatabases.pro index d2726d08a0..f2bac9ab94 100644 --- a/src/platformsupport/fontdatabases/fontdatabases.pro +++ b/src/platformsupport/fontdatabases/fontdatabases.pro @@ -9,25 +9,25 @@ PRECOMPILED_HEADER = ../../corelib/global/qt_pch.h darwin { include($$PWD/mac/coretext.pri) -} else { - qtConfig(freetype) { - include($$PWD/freetype/freetype.pri) - } +} - unix { - include($$PWD/genericunix/genericunix.pri) - qtConfig(fontconfig) { - include($$PWD/fontconfig/fontconfig.pri) - } - } +qtConfig(freetype) { + include($$PWD/freetype/freetype.pri) +} - win32:!winrt { - include($$PWD/windows/windows.pri) +unix { + include($$PWD/genericunix/genericunix.pri) + qtConfig(fontconfig) { + include($$PWD/fontconfig/fontconfig.pri) } +} - winrt { - include($$PWD/winrt/winrt.pri) - } +win32:!winrt { + include($$PWD/windows/windows.pri) +} + +winrt { + include($$PWD/winrt/winrt.pri) } load(qt_module) diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro index 4f2f56f01f..7dbb6f6cae 100644 --- a/src/platformsupport/platformsupport.pro +++ b/src/platformsupport/platformsupport.pro @@ -16,7 +16,7 @@ qtConfig(evdev)|qtConfig(tslib)|qtConfig(libinput)|qtConfig(integrityhid) { input.depends += devicediscovery } -unix:!darwin: \ +if(unix:!darwin)|qtConfig(xcb): \ SUBDIRS += services qtConfig(opengl): \ diff --git a/src/platformsupport/themes/themes.pro b/src/platformsupport/themes/themes.pro index aeed4d2f47..44f94fafc8 100644 --- a/src/platformsupport/themes/themes.pro +++ b/src/platformsupport/themes/themes.pro @@ -6,7 +6,7 @@ CONFIG += static internal_module DEFINES += QT_NO_CAST_FROM_ASCII -unix:!darwin: \ +if(unix:!darwin)|qtConfig(xcb): \ include($$PWD/genericunix/genericunix.pri) HEADERS += \ diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 01d493156d..a2c56a3dcf 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -4,6 +4,8 @@ QT += core-private gui-private xcb_qpa_lib-private DEFINES += QT_NO_FOREACH +macos: CONFIG += no_app_extension_api_only + SOURCES = \ qxcbmain.cpp OTHER_FILES += xcb.json README diff --git a/src/widgets/kernel/mac.pri b/src/widgets/kernel/mac.pri index 8c694c5e05..f7e7aa869a 100644 --- a/src/widgets/kernel/mac.pri +++ b/src/widgets/kernel/mac.pri @@ -1,4 +1,4 @@ -!x11:osx { +macos { LIBS_PRIVATE += -framework AppKit -lz *-mwerks:INCLUDEPATH += compat } |