Skip to content

Conversation

@pawelpetruch
Copy link

This PR updates several PX4 Homebrew formulas (asio@1.10.8, fastcdr, foonathan-memory, fastdds) to improve compatibility with modern macOS toolchains, especially on Apple Silicon running under Rosetta 2.

Key changes

  • Consistent C++ standard
    Enforces -DCMAKE_CXX_STANDARD=14 (or higher) and disables compiler extensions for all formulas.

  • macOS-specific safety flags
    On macOS, explicitly sets:
    stdlib=libc++
    isysroot $(xcrun --sdk macosx --show-sdk-path)
    I$(SDK)/usr/include/c++/v1
    DCMAKE_OSX_ARCHITECTURES=x86_64 (ensures Rosetta builds work correctly)

  • Boost / Asio fix
    Pre-seeds ac_cv_header_boost_noncopyable_hpp=yes in asio@1.10.8 to bypass fragile header detection on macOS.

  • CMake policies
    Adds -DCMAKE_POLICY_VERSION_MINIMUM=3.5 consistently to silence compatibility warnings.

  • Disabled unnecessary components
    For fastdds, disables tests, examples, and tools to speed up builds and reduce dependencies.

Why this is needed
Without these changes:

  • Build fails with errors like fatal error: 'string' file not found or std::atomic not supported.
  • PX4 toolchain installation via brew install px4/px4/px4-dev is broken on current macOS setups.

Tested on

  • macOS Sonoma 15.x (Intel shell under Rosetta, Homebrew under /usr/local)

Verified working toolchain install via:
HOMEBREW_NO_AUTO_UPDATE=1 brew install px4/px4/px4-dev

@pawelpetruch
Copy link
Author

Related to: #98

@mrpollo
Copy link
Contributor

mrpollo commented Sep 24, 2025

Is this not working for you without Rosetta? Or are you just trying to add one more option?

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.

3 participants