Add basic iOS target

This commit is contained in:
Dzmitry Malyshau 2020-09-19 23:12:12 -04:00
parent e109587bf0
commit 9ca2bb9ddb
5 changed files with 43 additions and 8 deletions

View file

@ -11,20 +11,27 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [macos-10.15, windows-2019] name: ['macOS stable', 'iOS stable', 'Windows stable']
include: include:
- name: MacOS Stable - name: macOS stable
os: macos-10.15 os: macos-10.15
key: macos target: x86_64-apple-darwin
- name: Windows Stable - name: iOS stable
os: macos-10.15
target: aarch64-apple-ios
- name: Windows stable
os: windows-2019 os: windows-2019
key: windows target: x86_64-pc-windows-msvc
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- if: matrix.os == 'windows-2019' - if: matrix.os == 'windows-2019'
name: Install make name: Install make
run: choco install make run: choco install make
- run: make gfx-portability.zip - run: rustup target add ${{ matrix.target }}
- name: Build
env:
CARGO_BUILD_TARGET: $${ matrix.target }
run: make gfx-portability.zip
- name: Upload builds - name: Upload builds
id: upload-release-asset id: upload-release-asset
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
@ -33,5 +40,5 @@ jobs:
with: with:
upload_url: ${{ github.event.release.upload_url }} upload_url: ${{ github.event.release.upload_url }}
asset_path: ./gfx-portability.zip asset_path: ./gfx-portability.zip
asset_name: gfx-portability-${{ matrix.key }}-${{ github.event.release.tag_name }}.zip asset_name: gfx-portability-${{ github.event.release.tag_name }}.${{ matrix.target }}.zip
asset_content_type: application/zip asset_content_type: application/zip

View file

@ -33,6 +33,12 @@ CFLAGS=-std=c++11 -ggdb -O0 -Iheaders
DEPS= DEPS=
LDFLAGS= LDFLAGS=
ifeq ($(CARGO_BUILD_TARGET),)
JSON_SUFFIX=$(OS_NAME)-*
else
JSON_SUFFIX=$(CARGO_BUILD_TARGET)
endif
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
LDFLAGS= LDFLAGS=
BACKEND=dx12 BACKEND=dx12
@ -56,6 +62,7 @@ else
DEBUGGER=rust-lldb -- DEBUGGER=rust-lldb --
LIB_FILE_NAME=libportability.dylib LIB_FILE_NAME=libportability.dylib
LIB_VULKAN_NAME=libvulkan.dylib LIB_VULKAN_NAME=libvulkan.dylib
#TODO: find a more idiomatic way to pass this arguments!
CLINK_ARGS=-- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0" CLINK_ARGS=-- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
OS_NAME=macos OS_NAME=macos
endif endif
@ -175,7 +182,7 @@ gfx-portability.zip: version-debug version-release
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) --release cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) --release
echo "$(GIT_TAG_FULL)" > commit-sha echo "$(GIT_TAG_FULL)" > commit-sha
$(ZIP_COMMAND) gfx-portability.zip target/*/$(LIB_FILE_NAME) libportability-icd/portability-$(OS_NAME)-*.json commit-sha $(ZIP_COMMAND) gfx-portability.zip target/$(CARGO_BUILD_TARGET)/*/$(LIB_FILE_NAME) libportability-icd/portability-$(JSON_SUFFIX).json commit-sha
target/debug/$(LIB_VULKAN_NAME): target/debug/$(LIB_VULKAN_NAME):
cd target/debug && ln -sf $(LIB_FILE_NAME) $(LIB_VULKAN_NAME) cd target/debug && ln -sf $(LIB_FILE_NAME) $(LIB_VULKAN_NAME)

View file

@ -0,0 +1,7 @@
{
"file_format_version": "1.0.0",
"ICD": {
"library_path": "../target/aarch64-apple-ios/release/libportability_icd.dylib",
"api_version": "1.0.0"
}
}

View file

@ -0,0 +1,7 @@
{
"file_format_version": "1.0.0",
"ICD": {
"library_path": "../target/x86_64-apple-darwin/release/libportability_icd.dylib",
"api_version": "1.0.0"
}
}

View file

@ -0,0 +1,7 @@
{
"file_format_version": "1.0.0",
"ICD": {
"library_path": "..\\target\\x86_64-pc-windows-msvc\\release\\portability_icd.dll",
"api_version": "1.0.0"
}
}