-
Notifications
You must be signed in to change notification settings - Fork 49
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
Conversation
CMakeLists.txt
Outdated
@@ -162,7 +157,6 @@ else() | |||
endif() | |||
endif() | |||
|
|||
include_directories ("${PROJECT_SOURCE_DIR}/include") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not required?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you!
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.