Skip to content

Commit ad2e228

Browse files
bors[bot]kvark
andcommitted
Merge #222
222: Add basic iOS target r=kvark a=kvark Co-authored-by: Dzmitry Malyshau <[email protected]>
2 parents e109587 + 9ca2bb9 commit ad2e228

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,25 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [macos-10.15, windows-2019]
14+
name: ['macOS stable', 'iOS stable', 'Windows stable']
1515
include:
16-
- name: MacOS Stable
16+
- name: macOS stable
1717
os: macos-10.15
18-
key: macos
19-
- name: Windows Stable
18+
target: x86_64-apple-darwin
19+
- name: iOS stable
20+
os: macos-10.15
21+
target: aarch64-apple-ios
22+
- name: Windows stable
2023
os: windows-2019
21-
key: windows
24+
target: x86_64-pc-windows-msvc
2225
steps:
2326
- uses: actions/checkout@v2
2427
- if: matrix.os == 'windows-2019'
2528
name: Install make
2629
run: choco install make
27-
- run: make gfx-portability.zip
30+
- run: rustup target add ${{ matrix.target }}
31+
- name: Build
32+
run: make CARGO_BUILD_TARGET=${{ matrix.target }} gfx-portability.zip
2833
- name: Upload builds
2934
id: upload-release-asset
3035
uses: actions/upload-release-asset@v1
@@ -33,5 +38,5 @@ jobs:
3338
with:
3439
upload_url: ${{ github.event.release.upload_url }}
3540
asset_path: ./gfx-portability.zip
36-
asset_name: gfx-portability-${{ matrix.key }}-${{ github.event.release.tag_name }}.zip
41+
asset_name: gfx-portability-${{ github.event.release.tag_name }}.${{ matrix.target }}.zip
3742
asset_content_type: application/zip

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ CFLAGS=-std=c++11 -ggdb -O0 -Iheaders
3333
DEPS=
3434
LDFLAGS=
3535

36+
ifeq ($(CARGO_BUILD_TARGET),)
37+
JSON_SUFFIX=$(OS_NAME)-*
38+
else
39+
JSON_SUFFIX=$(CARGO_BUILD_TARGET)
40+
endif
41+
3642
ifeq ($(OS),Windows_NT)
3743
LDFLAGS=
3844
BACKEND=dx12
@@ -56,6 +62,7 @@ else
5662
DEBUGGER=rust-lldb --
5763
LIB_FILE_NAME=libportability.dylib
5864
LIB_VULKAN_NAME=libvulkan.dylib
65+
#TODO: find a more idiomatic way to pass this arguments!
5966
CLINK_ARGS=-- -Clink-arg="-current_version 1.0.0" -Clink-arg="-compatibility_version 1.0.0"
6067
OS_NAME=macos
6168
endif
@@ -175,7 +182,7 @@ gfx-portability.zip: version-debug version-release
175182
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND)
176183
cargo build --manifest-path libportability-icd/Cargo.toml --features $(BACKEND) --release
177184
echo "$(GIT_TAG_FULL)" > commit-sha
178-
$(ZIP_COMMAND) gfx-portability.zip target/*/$(LIB_FILE_NAME) libportability-icd/portability-$(OS_NAME)-*.json commit-sha
185+
$(ZIP_COMMAND) gfx-portability.zip target/$(CARGO_BUILD_TARGET)/*/$(LIB_FILE_NAME) libportability-icd/portability-$(JSON_SUFFIX).json commit-sha
179186

180187
target/debug/$(LIB_VULKAN_NAME):
181188
cd target/debug && ln -sf $(LIB_FILE_NAME) $(LIB_VULKAN_NAME)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"file_format_version": "1.0.0",
3+
"ICD": {
4+
"library_path": "../target/aarch64-apple-ios/release/libportability_icd.dylib",
5+
"api_version": "1.0.0"
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"file_format_version": "1.0.0",
3+
"ICD": {
4+
"library_path": "../target/x86_64-apple-darwin/release/libportability_icd.dylib",
5+
"api_version": "1.0.0"
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"file_format_version": "1.0.0",
3+
"ICD": {
4+
"library_path": "..\\target\\x86_64-pc-windows-msvc\\release\\portability_icd.dll",
5+
"api_version": "1.0.0"
6+
}
7+
}

0 commit comments

Comments
 (0)