Skip to content

Commit

Permalink
Merge #222
Browse files Browse the repository at this point in the history
222: Add basic iOS target r=kvark a=kvark

Co-authored-by: Dzmitry Malyshau <[email protected]>
  • Loading branch information
bors[bot] and kvark committed Sep 20, 2020
2 parents e109587 + 9ca2bb9 commit ad2e228
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 8 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions libportability-icd/portability-aarch64-apple-ios.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
7 changes: 7 additions & 0 deletions libportability-icd/portability-x86_64-apple-darwin.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
7 changes: 7 additions & 0 deletions libportability-icd/portability-x86_64-pc-windows-msvc.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit ad2e228

Please sign in to comment.