-
Notifications
You must be signed in to change notification settings - Fork 21
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
Handle universal/fat binaries #2
Comments
Do you have an example that is working? I cannot find it anywhere. |
Sorry for the delay, I had notifications turned off on my own repo... I'd like to see what you can come up with :), I resigned myself to using separate archs + a custom script invoking |
Any news about how to create it? Whats the current solution? Create one profile for each arch and after join with lipo externally? Thanks. |
This is currently what I'm doing. Although you can use a single profile and change the
|
The only thing I've found is that all archs for the same platform can be included in the same profile, maybe something like the following will work (example only for iOS): diff --git a/conanfile.py b/conanfile.py
index dcfe743..3334407 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -48,6 +48,9 @@ class DarwinToolchainConan(ConanFile):
if self.settings.os == "watchOS" and self.settings.arch == "armv8":
darwin_arch = "arm64_32"
+ if self.settings.os == "iOS":
+ darwin_arch = ["arm64", "armv7"]
+
xcrun = tools.XCRun(self.settings)
sysroot = xcrun.sdk_path
@@ -67,10 +70,19 @@ class DarwinToolchainConan(ConanFile):
# CMake issue, for details look https://github.com/conan-io/conan/issues/2378
cflags = copy.copy(common_flags)
- cflags.extend(["-arch", darwin_arch])
+ if self.settings.os != "iOS":
+ cflags.extend(["-arch", darwin_arch])
+ else:
+ for arch in darwin_arch:
+ cflags.extend(["-arch", arch])
+
self.cpp_info.cflags = cflags
link_flags = copy.copy(common_flags)
- link_flags.append("-arch %s" % darwin_arch)
+ if self.settings.os != "iOS":
+ link_flags.append("-arch %s" % darwin_arch)
+ else:
+ for arch in darwin_arch:
+ link_flags.append("-arch %s" % arch)
self.cpp_info.sharedlinkflags.extend(link_flags)
self.cpp_info.exelinkflags.extend(link_flags) |
Will be nice implement array of arch, i agree. In my tool i have created all steps to generate universal framework in our business: Thanks anyway. |
Unfortunately, there is no way for a consumer to provide multiple archs to the recipe, this is a Conan limitation. The toolchain could force all architectures as you mention, but there is no way to select only a few architectures (e.g. there are currently 5 architectures for iOS IIRC). Furthermore, you'd have to find a way to set the package ID accordingly depending on the archs you used (to avoid colliding two packages built with I think this issue should be reconsidered if Conan introduces support for multiple values' settings/options. I would advise you to open an issue about this topic (or find an already opened one), there might be other use-cases for multiple values' settings than the one we're discussing here. |
the link does not work anymore, but I found your repo @PRSolucoes , ezored , looks interesting and could be exactly what I need to kick start me with conan (to which I am pretty new) for what I need, what is djiini + some things for android ios , so exactly what you prepared |
In Apple world it's quite common to have a binary with multiple architectures merged together.
There is a conan issue discussing about a generic implementation. Since it's quite hard to find such an implementation, I was thinking that a particular, Apple specific one can be added as part of this package.
If you agree, I can start working on something, using the examples from the mentioned issue.
The text was updated successfully, but these errors were encountered: