macOS: update build for Apple Silicon and Homebrew#1453
Open
mikefsq wants to merge 1 commit into
Open
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.
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.
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.