diff --git a/.gitignore b/.gitignore index 3cc5ecc37..c91559bcd 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ VCMI_VS11.sdf *.ipch VCMI_VS11.opensdf .DS_Store +CMakeUserPresets.json # Visual Studio *.suo diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d5789772..1c57c3f00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,6 +160,7 @@ set(CMAKE_MAP_IMPORTED_CONFIG_RELEASE Release RelWithDebInfo MinSizeRel "") set(CMAKE_XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT[variant=Debug] dwarf) set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE NO) +set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_64_TO_32_BIT_CONVERSION NO) set(CMAKE_XCODE_ATTRIBUTE_MARKETING_VERSION ${APP_SHORT_VERSION}) set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH NO) set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH[variant=Debug] YES) diff --git a/CMakePresets.json b/CMakePresets.json index 20a5a23ed..8626fc6c1 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -2,19 +2,31 @@ "version": 2, "configurePresets": [ { - "name": "default-release", + "name": "release-binary-dir", + "hidden": true, + "binaryDir": "${sourceDir}/out/build/${presetName}" + }, + { + "name": "base-release", + "inherits": "release-binary-dir", "hidden": true, - "binaryDir": "${sourceDir}/out/build/${presetName}", - "generator": "Ninja", "cacheVariables": { "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}", "PACKAGE_FILE_NAME" : "$env{VCMI_PACKAGE_FILE_NAME}", "PACKAGE_NAME_SUFFIX" : "$env{VCMI_PACKAGE_NAME_SUFFIX}", "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "FORCE_BUNDLED_FL": "OFF", "ENABLE_TEST": "OFF" } }, + { + "name": "default-release", + "inherits": "base-release", + "hidden": true, + "generator": "Ninja", + "cacheVariables": { + "FORCE_BUNDLED_FL": "OFF" + } + }, { "name" : "linux-release", "inherits" : "default-release", @@ -87,6 +99,41 @@ "description": "VCMI MacOS Xcode", "inherits": "default-release", "generator": "Xcode" + }, + { + "name": "ios-device", + "displayName": "Base iOS device", + "description": "Base VCMI preset for iOS device", + "generator": "Xcode", + "binaryDir": "../build-${presetName}", + "cacheVariables": { + "CMAKE_SYSTEM_NAME": "iOS", + "FORCE_BUNDLED_FL": "ON", + "FORCE_BUNDLED_MINIZIP": "ON" + } + }, + { + "name": "ios-simulator", + "displayName": "Base iOS simulator", + "description": "Base VCMI preset for iOS simulator", + "inherits": "ios-device", + "cacheVariables": { + "CMAKE_OSX_SYSROOT": "iphonesimulator" + } + }, + { + "name": "ios-release", + "displayName": "iOS release", + "description": "VCMI iOS release", + "inherits": [ + "base-release", + "ios-device", + "release-binary-dir" + ], + "cacheVariables": { + "BUNDLE_IDENTIFIER_PREFIX": "eu.vcmi", + "CMAKE_PREFIX_PATH": "TODO" + } } ], "buildPresets": [ @@ -135,6 +182,17 @@ "name": "windows-msvc-relwithdebinfo", "configurePreset": "windows-msvc-release", "inherits": "default-release" + }, + { + "name": "ios-release", + "configurePreset": "ios-release", + "inherits": "default-release", + "targets": ["vcmiclient"], + "nativeToolOptions": [ + "-quiet", + "CODE_SIGNING_ALLOWED_FOR_APPS=NO", + "GCC_OPTIMIZATION_LEVEL=3" + ] } ], "testPresets": [ @@ -172,4 +230,4 @@ "inherits": "default-release" } ] -} \ No newline at end of file +} diff --git a/configure_ios.sh b/configure_ios.sh deleted file mode 100755 index a27ef6c33..000000000 --- a/configure_ios.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -prefixPath=~/dev/vcmi/vcmi-ios-depends/build/iphoneos -if [[ "$1" ]]; then - prefixPath=~/dev/vcmi/vcmi-ios-depends/build/iphonesimulator -fi - -# -DCMAKE_OSX_SYSROOT=iphonesimulator - -cmake ../vcmi -G Xcode \ - -DCMAKE_SYSTEM_NAME=iOS \ - -DFORCE_BUNDLED_MINIZIP=ON \ - -DBUNDLE_IDENTIFIER_PREFIX=com.kambala \ - -Wno-dev \ - -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ - -DCMAKE_PREFIX_PATH="$prefixPath" \ - -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY='Apple Development' \ - -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM='4XHN44TEVG' - # -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=NO