222: Add basic iOS target r=kvark a=kvark

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot] 2020-09-20 03:15:11 +00:00 committed by Dzmitry Malyshau
commit ad2e228947
5 changed files with 41 additions and 8 deletions

View file

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

View file

@ -33,6 +33,12 @@ CFLAGS=-std=c++11 -ggdb -O0 -Iheaders
DEPS=
LDFLAGS=
ifeq ($(CARGO_BUILD_TARGET),)
JSON_SUFFIX=$(OS_NAME)-*
else
JSON_SUFFIX=$(CARGO_BUILD_TARGET)
endif
ifeq ($(OS),Windows_NT)
LDFLAGS=
BACKEND=dx12
@ -56,6 +62,7 @@ else
DEBUGGER=rust-lldb --
LIB_FILE_NAME=libportability.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"
OS_NAME=macos
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) --release
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):
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"
}
}