Skip to content

macOS: update build for Apple Silicon and Homebrew#1453

Open
mikefsq wants to merge 1 commit into
OpenPHDGuiding:masterfrom
mikefsq:macos-build
Open

macOS: update build for Apple Silicon and Homebrew#1453
mikefsq wants to merge 1 commit into
OpenPHDGuiding:masterfrom
mikefsq:macos-build

Conversation

@mikefsq

@mikefsq mikefsq commented Jun 16, 2026

Copy link
Copy Markdown

Update the PHD2 build process to build an Apple Silicon binary (or a universal binary if all of the dependencies are also universal binaries). This adds support for linking against the library versions installed by a current homebrew toolchain. Note that this preserves the existing linking behavior which on osx only finds static dependencies, so a homebrew user will now see an error message to set PHD_MACOS_STATIC_DEPS off.

Two reported bugs are also addressed by this update:

Changes:

  • run_cmake-osx: default CMAKE_OSX_ARCHITECTURES to the host arch ($(uname -m)) instead of hardcoded x86_64; override APPLE_ARCH for a universal build.

  • thirdparty.cmake: add PHD_MACOS_STATIC_DEPS (default ON) to choose static cfitsio/libnova for a self-contained bundle vs shared libs (e.g. Homebrew); emit a clear message when a static lib is missing.

  • thirdparty.cmake: link zlib where the static INDI client is linked (it needs uncompress for BLOBs) via find_package(ZLIB).

  • thirdparty.cmake: recover the Eigen include dir from the Eigen3::Eigen target when EIGEN3_INCLUDE_DIR is unset (config-only Eigen 3.4+).

  • thirdparty.cmake: SBIG off by default (no arm64 driver), SVB and ogmacam point at universal/arm64 lib paths, non-fatal skips so universal/arm64 builds still configure.

  • CMakeLists.txt: define wxNO_REQUIRE_LITERAL_MSGIDS for wxWidgets >= 3.3.

  • ship universal (arm64+x86_64) libASICamera2 and libqhyccd dylibs.

Make PHD2 build cleanly on Apple Silicon and against an up-to-date
Homebrew toolchain, while keeping the existing static/release build path.

- run_cmake-osx: default CMAKE_OSX_ARCHITECTURES to the host arch
  ($(uname -m)) instead of hardcoded x86_64; override APPLE_ARCH for a
  universal build.
- thirdparty.cmake: add PHD_MACOS_STATIC_DEPS (default ON) to choose
  static cfitsio/libnova for a self-contained bundle vs shared libs
  (e.g. Homebrew); emit a clear message when a static lib is missing.
- thirdparty.cmake: link zlib where the static INDI client is linked
  (it needs uncompress for BLOBs) via find_package(ZLIB).
- thirdparty.cmake: recover the Eigen include dir from the Eigen3::Eigen
  target when EIGEN3_INCLUDE_DIR is unset (config-only Eigen 3.4+).
- thirdparty.cmake: SBIG off by default (no arm64 driver), SVB and
  ogmacam point at universal/arm64 lib paths, non-fatal skips so
  universal/arm64 builds still configure.
- CMakeLists.txt: define wxNO_REQUIRE_LITERAL_MSGIDS for wxWidgets >= 3.3.
- ship universal (arm64+x86_64) libASICamera2 and libqhyccd dylibs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant