-
Notifications
You must be signed in to change notification settings - Fork 985
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
Bugfix: fix iOS CMake architecture #7157 #7164
Bugfix: fix iOS CMake architecture #7157 #7164
Conversation
Signed-off-by: SSE4 <[email protected]>
conans/client/build/cmake_flags.py
Outdated
definitions["CMAKE_OSX_ARCHITECTURES"] = tools.to_apple_arch(arch) | ||
# xcrun is only available on macOS, otherwise it's cross-compiling and it needs to be | ||
# set within CMake toolchain | ||
if platform.system == "Darwin": |
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.
Isn't this missing a ()?
platform.system() == "Darwin"
Maybe the test patch is hiding this.
# xcrun is only available on macOS, otherwise it's cross-compiling and it needs to be | ||
# set within CMake toolchain | ||
if platform.system == "Darwin": | ||
definitions["CMAKE_OSX_SYSROOT"] = tools.XCRun(self._conanfile.settings).sdk_path |
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.
The default CMake behavior is:
If not set explicitly the value is initialized by the SDKROOT environment variable, if set, and otherwise computed based on the CMAKE_OSX_DEPLOYMENT_TARGET or the host platform.
Is it expected that conan overrides the SDKROOT env variable if defined? Is the xcrun
using the SDKROOT env var?
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.
yes, it does (https://www.manpagez.com/man/1/xcrun/):
SDKROOT Specifies the SDK to use; overriden by the command line
-sdk option.
I found this broke a build workflow I was using with conan. With careful setting of environment variables like |
backport of #7157 to release/1.26
closes: #7156
Changelog: Bugfix: Fix iOS CMake architecture.
Docs: omit
need to set CMAKE_OSX_ARCHITECTURES and CMAKE_OSX_SYSROOT
develop
branch, documenting this one.Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.