From 524ad5ab76bcb015aa3b520d6ca03b59c39260a8 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Thu, 13 Oct 2022 13:09:15 +0300 Subject: [PATCH] [CI] build iOS with Conan --- .github/workflows/github.yml | 3 +- CI/ios/before_install.sh | 4 +-- CMakePresets.json | 63 +++++++++++++++++++++++++++++------- 3 files changed, 56 insertions(+), 14 deletions(-) diff --git a/.github/workflows/github.yml b/.github/workflows/github.yml index 2eb8f354a..48044beeb 100644 --- a/.github/workflows/github.yml +++ b/.github/workflows/github.yml @@ -95,7 +95,8 @@ jobs: test: 0 pack: 1 extension: ipa - preset: ios-release + preset: ios-release-conan + conan_profile: ios-arm64 - platform: mxe os: ubuntu-20.04 mxe: i686-w64-mingw32.shared diff --git a/CI/ios/before_install.sh b/CI/ios/before_install.sh index b19cd9828..69e459d86 100755 --- a/CI/ios/before_install.sh +++ b/CI/ios/before_install.sh @@ -2,6 +2,6 @@ echo DEVELOPER_DIR=/Applications/Xcode_13.4.1.app >> $GITHUB_ENV -curl -L 'https://github.com/vcmi/vcmi-ios-deps/releases/latest/download/vcmi-ios-depends-xc13.2.1.txz' \ +mkdir ~/.conan ; cd ~/.conan +curl -L 'https://github.com/vcmi/vcmi-ios-deps/releases/download/1.1/ios-arm64.xz' \ | tar -xf - -build/fix_install_paths.command diff --git a/CMakePresets.json b/CMakePresets.json index dc9db320c..2083e312d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -6,6 +6,14 @@ "hidden": true, "binaryDir": "${sourceDir}/out/build/${presetName}" }, + { + "name": "build-with-conan", + "hidden": true, + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan-generated/conan_toolchain.cmake", + "FORCE_BUNDLED_MINIZIP": "OFF" + } + }, { "name": "base-release", "inherits": "release-binary-dir", @@ -81,9 +89,11 @@ "name": "macos-conan-ninja-release", "displayName": "Ninja+Conan release", "description": "VCMI MacOS Ninja using Conan", - "inherits": "default-release", + "inherits": [ + "build-with-conan", + "default-release" + ], "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/conan-generated/conan_toolchain.cmake", "CMAKE_BUILD_TYPE": "Release" } }, @@ -122,16 +132,42 @@ } }, { - "name": "ios-release", - "displayName": "iOS release", - "description": "VCMI iOS release", + "name": "ios-device-conan", + "displayName": "Base iOS device using Conan", + "description": "Base VCMI preset for iOS device using Conan", "inherits": [ - "base-release", - "ios-device", - "release-binary-dir" + "build-with-conan", + "ios-device" + ] + }, + { + "name": "base-ios-release", + "displayName": "Base iOS release", + "description": "Base VCMI preset for iOS release", + "inherits": "base-release", + "hidden": true, + "cacheVariables": { + "BUNDLE_IDENTIFIER_PREFIX": "eu.vcmi" + } + }, + { + "name": "ios-release-conan", + "displayName": "iOS+Conan release", + "description": "VCMI iOS release using Conan", + "inherits": [ + "base-ios-release", + "ios-device-conan" + ] + }, + { + "name": "ios-release-legacy", + "displayName": "iOS release using legacy dependencies", + "description": "VCMI iOS release using legacy dependencies", + "inherits": [ + "base-ios-release", + "ios-device" ], "cacheVariables": { - "BUNDLE_IDENTIFIER_PREFIX": "eu.vcmi", "CMAKE_PREFIX_PATH": "${sourceDir}/build/iphoneos" } } @@ -184,14 +220,19 @@ "inherits": "default-release" }, { - "name": "ios-release", - "configurePreset": "ios-release", + "name": "ios-release-conan", + "configurePreset": "ios-release-conan", "inherits": "default-release", "configuration": "Release", "targets": ["vcmiclient"], "nativeToolOptions": [ "CODE_SIGNING_ALLOWED_FOR_APPS=NO" ] + }, + { + "name": "ios-release-legacy", + "configurePreset": "ios-release-legacy", + "inherits": "ios-release-conan" } ], "testPresets": [