Skip to content

Commit

Permalink
chore: update min version for macosx
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Dec 6, 2024
1 parent e957424 commit fe8d7bd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,23 @@ jobs:
build-apple:
runs-on: macos-latest-large
# if: github.event.inputs.target == 'apple' || github.event.inputs.target == 'all'
strategy:
matrix:
target:
[
aarch64-apple-darwin,
x86_64-apple-darwin,
aarch64-apple-ios,
x86_64-apple-ios,
aarch64-apple-ios-sim,
]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commitSHA || github.ref }}

- uses: Homebrew/actions/setup-homebrew@master
- uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: "14.1"
- uses: ningenMe/[email protected]

- name: Install Make
Expand All @@ -47,18 +54,15 @@ jobs:
TARGET: apple

- name: Build Apple
# env:
# APPLE_XCODE_APP_NAME: Xcode_14.1.app
# APPLE_MACOSX_SDK: MacOSX13.0
run: |
rm -f /usr/local/lib/libjpeg*
make apple
make ${{ matrix.target }}
- name: Upload Apple Artifacts
uses: actions/upload-artifact@v4
with:
name: dotlottie-player.darwin.tar.gz
path: release/apple/dotlottie-player.darwin.tar.gz
name: dotlottie-player.${{ matrix.target }}.tar.gz
path: release/apple/dotlottie-player.${{ matrix.target }}.tar.gz
if-no-files-found: error

build-android:
Expand Down
28 changes: 17 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ APPLE_BUILD := $(BUILD)/$(APPLE)
APPLE_IOS := ios
APPLE_IOS_PLATFORM := iPhoneOS
APPLE_IOS_SDK ?= iPhoneOS
# APPLE_IOS_VERSION_MIN ?= 15.4
THORVG_APPLE_IOS_VERSION_MIN ?= 13.0 # Minimum iOS version supported by ThorVG, needs to be the same for cpp_args and cpp_link_args
APPLE_MACOS_VERSION_MIN ?= 10.15
APPLE_IOS_VERSION_MIN ?= 13.0
APPLE_XCODE_APP_NAME ?= Xcode.app

APPLE_IOS_SIMULATOR := ios-simulator
Expand Down Expand Up @@ -226,8 +226,14 @@ has_function_printf = true

$(if $(filter $(PLATFORM),$(APPLE_IOS_PLATFORM) $(APPLE_IOS_SIMULATOR_PLATFORM)),\
[built-in options]\n\
cpp_args = ['-miphoneos-version-min=$(THORVG_APPLE_IOS_VERSION_MIN)']\n\
cpp_link_args = ['-miphoneos-version-min=$(THORVG_APPLE_IOS_VERSION_MIN)']\n\
cpp_args = ['-miphoneos-version-min=$(APPLE_IOS_VERSION_MIN)']\n\
cpp_link_args = ['-miphoneos-version-min=$(APPLE_IOS_VERSION_MIN)']\n\
,)

$(if $(filter $(PLATFORM),$(APPLE_MACOSX_PLATFORM)),\
[built-in options]\n\
cpp_args = ['-mmacosx-version-min=$(APPLE_MACOS_VERSION_MIN)']\n\
cpp_link_args = ['-mmacosx-version-min=$(APPLE_MACOS_VERSION_MIN)']\n\
,)

[host_machine]
Expand Down Expand Up @@ -365,8 +371,8 @@ define CLEAN_LIBGJPEG
endef

define SIMPLE_CARGO_BUILD
IPHONEOS_DEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN) \
MACOSX_DEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN) \
IPHONEOS_DEPLOYMENT_TARGET=$(APPLE_IOS_VERSION_MIN) \
MACOSX_DEPLOYMENT_TARGET=$(APPLE_MACOS_VERSION_MIN) \
cargo build \
--manifest-path $(PROJECT_DIR)/Cargo.toml \
--release;
Expand All @@ -382,8 +388,8 @@ define CARGO_BUILD
--target $(CARGO_TARGET) \
--release; \
else \
IPHONEOS_DEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN) \
MACOSX_DEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN) \
IPHONEOS_DEPLOYMENT_TARGET=$(APPLE_IOS_VERSION_MIN) \
MACOSX_DEPLOYMENT_TARGET=$(APPLE_MACOS_VERSION_MIN) \
cargo build \
--manifest-path $(PROJECT_DIR)/Cargo.toml \
--target $(CARGO_TARGET) \
Expand Down Expand Up @@ -456,7 +462,7 @@ define CREATE_FRAMEWORK
-c "Add :CFBundleShortVersionString string 1.0.0" \
-c "Add :CFBundlePackageType string FMWK" \
-c "Add :CFBundleExecutable string $(DOTLOTTIE_PLAYER_MODULE)" \
-c "Add :MinimumOSVersion string $(THORVG_APPLE_IOS_VERSION_MIN)" \
-c "Add :MinimumOSVersion string $(APPLE_IOS_VERSION_MIN)" \
-c "Add :CFBundleSupportedPlatforms array" \
$(foreach platform,$(PLIST_DISABLE),-c "Add :CFBundleSupportedPlatforms:0 string $(platform)" ) \
$(foreach platform,$(PLIST_ENABLE),-c "Add :CFBundleSupportedPlatforms:1 string $(platform)" ) \
Expand Down Expand Up @@ -569,7 +575,7 @@ define NEW_APPLE_CMAKE_BUILD
$4/$(CMAKE_CACHE): DEP_SOURCE_DIR := $(DEPS_MODULES_DIR)/$3
$4/$(CMAKE_CACHE): DEP_BUILD_DIR := $4
$4/$(CMAKE_CACHE): DEP_ARTIFACTS_DIR := $$($1_DEPS_ARTIFACTS_DIR)
$4/$(CMAKE_CACHE): CMAKE_BUILD_SETTINGS := -GXcode -DCMAKE_MACOSX_BUNDLE=NO -DMACOSX_DEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN) -DDEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN) -DIPHONEOS_DEPLOYMENT_TARGET=$(THORVG_APPLE_IOS_VERSION_MIN)
$4/$(CMAKE_CACHE): CMAKE_BUILD_SETTINGS := -GXcode -DCMAKE_MACOSX_BUNDLE=NO -DDEPLOYMENT_TARGET=$(if $(findstring DARWIN,$1),$(APPLE_MACOS_VERSION_MIN),$(APPLE_IOS_VERSION_MIN))
$4/$(CMAKE_CACHE): PLATFORM := -DPLATFORM=$$($1_ARCH)
$4/$(CMAKE_CACHE): TOOLCHAIN_FILE := -DCMAKE_TOOLCHAIN_FILE=$(PWD)/$(DEPS_MODULES_DIR)/ios-cmake/ios.toolchain.cmake
$4/$(CMAKE_CACHE):
Expand Down Expand Up @@ -619,7 +625,7 @@ endef

define NEW_THORVG_BUILD
# Setup meson for thorvg
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): export PKG_CONFIG_PATH := $(PWD)/$$($1_DEPS_LIB_DIR)/pkgconfig:$(PWD)/$$($1_DEPS_LIB64_DIR)/pkgconfig
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): export PKG_CONFIG_PATH := $(PWD)/$$($1_DEPS_LIB_DIR)/pkgconfig:$(PWD)/$$($1_DEPS_LIB64_DIR)
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): THORVG_DEP_SOURCE_DIR := $(DEPS_MODULES_DIR)/$(THORVG)
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): THORVG_DEP_BUILD_DIR := $$($1_THORVG_DEP_BUILD_DIR)
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): CROSS_FILE := --cross-file $$($1_THORVG_DEP_BUILD_DIR)/../$(MESON_CROSS_FILE)
Expand Down

0 comments on commit fe8d7bd

Please sign in to comment.