Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cross compilation rules for macos arm64/x86 and optimize circleci/config.yml #3484

Merged
merged 10 commits into from
Nov 3, 2023

Conversation

sgpearse
Copy link
Collaborator

@sgpearse sgpearse commented Oct 24, 2023

Fixes #3463. With CircleCI's deprecation of macOS/x86 executors, we need to start cross-compiling on arm64.

This PR also introduces reusable commands to reduce code repetition, and layer caching to save on compile time on the expensive M1 executors.

@sgpearse sgpearse marked this pull request as ready for review November 2, 2023 15:22
@NihanthCW NihanthCW requested a review from StasJ November 2, 2023 18:14
CMakeLists.txt Outdated
@@ -162,7 +157,6 @@ else()
endif()
endif()

include_directories ("${PROJECT_SOURCE_DIR}/include")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm perplexed on how the test builds were successful across multiple platforms. I've re-added this line. Thanks for the catch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As am I...

CMakeLists.txt Outdated
else()
message("Building on macOS x86 architecture")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "macOS build architecture" FORCE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should target the host architecture by default.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, native build platforms are now targeted by default. We can now target specific architectures by specifying CMAKE_OSX_ARCHITECTURES.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@sgpearse sgpearse requested a review from StasJ November 2, 2023 23:43
@sgpearse sgpearse merged commit e992a14 into main Nov 3, 2023
3 checks passed
@sgpearse sgpearse deleted the issue3463 branch November 3, 2023 17:06
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.

MacOS Gen1 and Gen2 being deprecated on CircleCI soon
2 participants