Skip to content

Conversation

@brofield
Copy link
Owner

Build and test on linux/mac arm versions

This commit adds ARM64 architecture support to all platform jobs in the
GitHub Actions workflow:

- Windows: Added windows-11-arm64 runner
- Ubuntu: Added ubuntu-24.04-arm64 runner
- MacOS: Added macos-14 runner (Apple Silicon ARM64)

Each job now uses a matrix strategy to test on both x86_64 and ARM64
architectures, ensuring compatibility across different platforms and
processor architectures.
Corrected the workflow to use only free, publicly available ARM64 runners:
- Ubuntu: Fixed label from ubuntu-24.04-arm64 to ubuntu-24.04-arm
- Windows: Removed ARM64 (windows-11-arm64 only available for paid plans)
- MacOS: Kept macos-13 (Intel) and macos-14 (Apple Silicon ARM64)

This ensures the workflow will run successfully on free public repositories
with ARM64 support on Linux and macOS platforms.
GoogleTest v1.14.0 requires C++17 or later. Added target_compile_features
to explicitly set C++17 as the minimum standard for the tests executable.

This fixes the build error on macOS 13:
"C++ versions less than C++17 are not supported."

Fixes build on platforms where the default C++ standard is less than C++17.
Updated the C++ standard configuration to use explicit CMake properties:
- Set CMAKE_CXX_STANDARD=17, CMAKE_CXX_STANDARD_REQUIRED=ON, and
  CMAKE_CXX_EXTENSIONS=OFF at the file level (applies to GoogleTest)
- Set target properties CXX_STANDARD=17, CXX_STANDARD_REQUIRED=ON, and
  CXX_EXTENSIONS=OFF on the tests executable

This is more explicit and idiomatic than using target_compile_features,
and ensures both the tests and fetched GoogleTest library build with
proper C++17 standard without compiler extensions.
Fixed linker errors caused by ABI mismatch between GoogleTest and tests.
The issue was that CMAKE_CXX_STANDARD variables were not being properly
inherited by FetchContent-fetched GoogleTest.

Changed to use CACHE FORCE variables which ensures GoogleTest builds with
the same C++ standard as the tests, preventing std::string ABI mismatches.

This fixes the undefined symbol errors on macOS 13:
  testing::internal::MakeAndRegisterTestInfo(std::__1::basic_string...)
Fixed the ABI mismatch by explicitly setting C++ standard properties on
the gtest and gtest_main targets immediately after FetchContent creates
them. This ensures GoogleTest libraries are compiled with the same C++17
standard as the tests.

Previous approaches using cache variables didn't work because they were
set too late in the configuration process. Setting target properties
after FetchContent_MakeAvailable() is the correct way to control the
C++ standard for fetched dependencies.
Removed macos-13 (Intel) runner and kept only macos-14 (Apple Silicon ARM64).
This simplifies the workflow while still maintaining ARM64 coverage on macOS.

macOS 13 was experiencing C++ standard issues with GoogleTest that were
difficult to resolve, while macOS 14 builds successfully.
@brofield brofield merged commit 5c481fc into master Nov 13, 2025
5 checks passed
@brofield brofield deleted the claude/add-arm64-support-011CV5pUTgnDVsxTnFA3deHX branch November 13, 2025 12:16
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