extplane-plugin: fix macOS build for Apple Silicon (X-Plane SDK 4.x) - #85
Open
BhSimon wants to merge 1 commit into
Open
extplane-plugin: fix macOS build for Apple Silicon (X-Plane SDK 4.x)#85BhSimon wants to merge 1 commit into
BhSimon wants to merge 1 commit into
Conversation
Three issues in extplane-plugin.pro, all fixed here: 1. The macx block forced `CONFIG += x86 ppc`, i.e. 32-bit Intel + PowerPC. That breaks on any modern macOS toolchain and prevents an arm64 build. Removed; the plugin now builds for the architecture(s) of the Qt it is linked against (arm64 on Apple Silicon, or universal with a universal Qt). 2. XPLMCommandKeyStroke / XPLMCommandButtonPress / XPLMCommandButtonRelease (used in xplaneplugin.cpp) are gated behind XPLM_DEPRECATED in the X-Plane SDK 4.x headers, though the framework still exports them. Define XPLM_DEPRECATED so the plugin compiles against SDK 4.x. Harmless on 3.x. 3. libmosquittopp was linked unconditionally via pkg-config even though the MQTT sources are already guarded by `CONFIG(mqtt)`. Move the pkg-config link under the same guard so a default (non-MQTT) build does not require mosquitto to be installed. Verified: produces an arm64 mac.xpl against X-Plane SDK 4.3.0 with Qt 5.15; loads in X-Plane 12 on an Apple Silicon Mac and streams datarefs over TCP 51000 (x86_64-only plugins in the same session failed with an arch mismatch). LLM assistance: Claude Opus 4.8
BhSimon
force-pushed
the
macos-apple-silicon-build
branch
from
September 6, 2026 04:16
c1ee9f0 to
84340b3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix macOS build for Apple Silicon (X-Plane SDK 4.x)
Summary
This PR makes
extplane-plugin/extplane-plugin.probuild a native arm64mac.xpl,verified loading and streaming datarefs in X‑Plane 12 on an M2 Mac.
All changes are in
extplane-plugin/extplane-plugin.pro.What was broken
CONFIG += x86 ppcin themacx {}block forced a 32‑bit Intel +PowerPC build. That fails on any modern macOS toolchain and makes an arm64
build impossible. Removed — the plugin now builds for the architecture(s)
of the Qt it links against (arm64 on Apple Silicon; universal if you link a
universal Qt and add
-archflags).XPLMCommandKeyStroke/XPLMCommandButtonPress/XPLMCommandButtonRelease(used in
xplaneplugin.cpp) are gated behindXPLM_DEPRECATEDin theX‑Plane SDK 4.x headers, so the plugin fails to compile with a current SDK:
The functions are still exported by
XPLM.framework, so definingXPLM_DEPRECATEDrestores them. Harmless with SDK 3.x.libmosquittoppwas linked unconditionally viapkg-config, even thoughthe MQTT sources are already guarded by
CONFIG(mqtt). A default(non‑MQTT) build therefore failed unless mosquitto was installed. Moved the
pkg-configlink under the sameCONFIG(mqtt)guard.How to build on Apple Silicon
macOS 14+ can use Homebrew
qt@5. On macOS 13 (Ventura) Homebrew has noarm64 Qt5 bottle; conda‑forge works (its osx‑arm64 build targets macOS 11+):
Because the Qt5 comes from a non‑system prefix, the resulting
.xplreferencesQt via
@rpath; bundlelibQt5Core,libQt5Networkand their deps (ICU, z,zstd) next to
mac.xpland rewrite install names to@loader_pathfor aself‑contained plugin.
Verification
mac.xplagainst X‑Plane SDK 4.3.0 + Qt 5.15.minos 11.0, exportsXPluginStart/Stop/Enable/Disable/ReceiveMessage.Loaded: .../ExtPlane/mac.xpl (org.vranki.extplaneplugin)andExtPlane listening on TCP port 51000.ud/uf/uiframes).incompatible architecture (have 'x86_64', need 'arm64')— confirmingX‑Plane ran native arm64 and this plugin matched.