diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2020-12-01 20:24:44 +0200 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2020-12-02 07:48:29 +0200 |
commit | 2ed189225580f49695560b59f4fe341da4444253 (patch) | |
tree | 281e2b18a97dde8f8e2276bd40e6469eeee98b04 | |
parent | 07a216f327bea9a4f7880fe44eda7e27c2bbe820 (diff) |
Conan: Fix iOS builds
Conan passes some autodetected iOS related CMake options like
CMAKE_SYSTEM_NAME, CMAKE_OSX_ARCHITECTURES, CMAKE_OSX_SYSROOT,
which apparently don't work out of the box.
- Explicitly pass 'iOS' for CMAKE_SYSTEM_NAME
- Remove the explicit sysroot 'CMAKE_OSX_SYSROOT', let CMake detect
the sysroots, to ensure that multi-arch builds work.
- Remove the conan provided architecture 'CMAKE_OSX_ARCHITECTURES',
instead rely on the architectures set by the Qt toolchain file,
which with official Qt packages most likely means multi-arch iOS.
Task-number: QTBUG-89020
Pick-to: 6.0 dev
Change-Id: I3c559f00f9391edf68bf88348baae561dc5f0991
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mike Krus <mike.krus@kdab.com>
-rw-r--r-- | conanfile.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/conanfile.py b/conanfile.py index 42558025f..02927ec60 100644 --- a/conanfile.py +++ b/conanfile.py @@ -95,6 +95,19 @@ class Qt3D(ConanFile): cmake.definitions["ANDROID_SDK_ROOT"] = self._read_env('ANDROID_SDK_ROOT') cmake.definitions["ANDROID_NDK_ROOT"] = self._read_env('ANDROID_NDK_ROOT') + if self.settings.os == "iOS": + # Instead of Conan's auto-added 'Darwin', explicitly pass 'iOS'. + cmake.definitions["CMAKE_SYSTEM_NAME"] = "iOS" + + # Remove the explicit sysroot, let CMake detect the sysroots, to ensure + # that multi-arch builds work. + del cmake.definitions["CMAKE_OSX_SYSROOT"] + + # Remove the conan provided architecture, instead rely on the architectures set + # by the Qt toolchain file, which with official Qt packages most likely means + # multi-arch iOS. + del cmake.definitions["CMAKE_OSX_ARCHITECTURES"] + for c in [ 'assimp', 'opengl_renderer', 'rhi_renderer']: value = os.environ.get('qt3d_' + c) if value: |