Open rohan-elear opened 4 years ago
I had this issue with some library also. It is most likely due to --host
and --build
having the same value.
Could you try autotools.configure(..., host="x86_64-apple-ios")
?
That did not work as well. If I change the profile to exclude the build_requires section, then it works but I am yet to test the binary on the simulator.
If you can share the recipe, I'll be able to reproduce the issue
If you can share the recipe, I'll be able to reproduce the issue
https://github.com/elear-solutions/meshlink/blob/elear-master/conanfile.py
Adding host="x86_64-apple-ios"
fixes the first issue on my machine, but it fails later on with catta
:
=== configuring in catta (/tmp/meshlink/build/catta) configure: WARNING: no configuration information is in catta /Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive Making all in catta make[2]: No rule to make target `all'. Stop. make[1]: [all-recursive] Error 1
for now I have written a _targets method to filter the target as per the input from conan
And did it fix your issue?
yeah sorry was busy applying the fix on all the conan files, yeah basically I wrote a lookup table by using the function to determine the host. That fixed the issue for now, maybe you can put this on your backlog :) thanks for all the help
I have trouble building libjpeg from conan-center for simulator. it is using autotools. curiously I found a very simple script that actually works here. is it possible to teach conan to do that using this profile?
@maddanio I've had the same error, which is unfortunately quite common with the AutoToolsBuildEnvironment
helper. The thing is that it guesses the host
wrong, and gives the same value to both --build
and --host
(i.e. x86_64-darwin-apple
, instead of x86_64-darwin-ios
).
You can override the default value by calling env_build.configure(..., host="x86_64-darwin-ios")
. I will open an issue to Conan about the helper, I had this problem several times in my recipes.
EDIT: For some reason, I've only understood now that this is likely a Conan problem...
The workaround I use to enable mutliple profile builds using the same file.
class libConan(ConanFile):
@property
def _targets(self):
return {
"iOS-x86-*": "i386-apple-ios",
"iOS-x86_64-*": "x86_64-apple-ios"
}
def config_options(self):
args = ["--prefix=${PWD}"]
return args
def build(self):
autotools = AutoToolsBuildEnvironment(self)
args = self.config_options()
self.run("cd .. && autoreconf -fsi ")
query = "%s-%s-%s" % (self.settings.os, self.settings.arch, self.settings.compiler)
ancestor = next((self._targets[i] for i in self._targets if fnmatch.fnmatch(query, i)), None)
if not ancestor:
autotools.configure(configure_dir= "..",args= args, use_default_install_dirs=True)
else:
autotools.configure(configure_dir= "..",args= args, use_default_install_dirs=True, host= ancestor)
I am trying to build some libraries using .configure but I am getting this error while trying to build it for iPhone Simulator for macOS.
Following is my profile:
build in conanfile.py
error while building for iOS simulator