Repository navigation
Conversation
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.
|
Tested this PR on Apple silicon: builds native and guides on the simulator. Machine
Build
Simulator (Simulator camera + On-camera mount, 3.75 µm, 240 mm, driven through the event server)
Notes
Separate from this PR: |
|
Follow-up: INDI on the same build (PR head dfc8d55, arm64). Setup
Result
Found, not from this PR: with |
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.