Skip to content

Commit 86de8df

Browse files
Add support for Apple tvOS builds (#848)
* Add Apple tvOS build option Signed-off-by: Mateusz Szczygieł <[email protected]> * Add script for testing tvOS build --------- Signed-off-by: Mateusz Szczygieł <[email protected]> Co-authored-by: Justin Smith <[email protected]>
1 parent 8e8b957 commit 86de8df

File tree

6 files changed

+541
-0
lines changed

6 files changed

+541
-0
lines changed

.github/workflows/cross.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,27 @@ jobs:
156156
- name: iOS Simulator Runner
157157
run: ./scripts/ci/ios-simulator-runner.sh
158158

159+
aws-lc-rs-tvos-aarch64:
160+
if: github.repository_owner == 'aws'
161+
name: tvOS aarch64 cross-platform build
162+
runs-on: macos-latest
163+
env:
164+
TVOS_FORCE_TEST: 1
165+
steps:
166+
- uses: actions/checkout@v3
167+
with:
168+
submodules: "recursive"
169+
- run: |
170+
brew install llvm
171+
- uses: dtolnay/rust-toolchain@master
172+
with:
173+
toolchain: nightly
174+
components: rust-src
175+
- name: Install bash, coreutils
176+
run: brew install bash coreutils
177+
- name: tvOS Simulator Runner
178+
run: ./scripts/ci/tvos-simulator-runner.sh
179+
159180
aws-lc-rs-ios-x86_64:
160181
if: github.repository_owner == 'aws'
161182
name: iOS x86-64 cross-platform build

aws-lc-fips-sys/builder/cmake_builder.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ impl CmakeBuilder {
249249
cmake_cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
250250
cmake_cfg.define("CMAKE_OSX_SYSROOT", "macosx");
251251
}
252+
if target_os().trim() == "tvos" {
253+
cmake_cfg.define("CMAKE_SYSTEM_NAME", "tvOS");
254+
if effective_target().ends_with("-tvos-sim") || target_arch() == "x86_64" {
255+
cmake_cfg.define("CMAKE_OSX_SYSROOT", "appletvsimulator");
256+
} else {
257+
cmake_cfg.define("CMAKE_OSX_SYSROOT", "appletvos");
258+
}
259+
}
252260
}
253261

254262
if target_os() == "windows" {

aws-lc-fips-sys/builder/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,7 @@ fn invoke_external_bindgen(
744744
if let Some(prefix_str) = &options.build_prefix {
745745
sym_prefix = if target_os().to_lowercase() == "macos"
746746
|| target_os().to_lowercase() == "ios"
747+
|| target_os().to_lowercase() == "tvos"
747748
|| (target_os().to_lowercase() == "windows" && target_arch() == "x86")
748749
{
749750
format!("_{prefix_str}_")

aws-lc-sys/builder/cmake_builder.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,14 @@ impl CmakeBuilder {
200200
cmake_cfg.define("CMAKE_SYSTEM_NAME", "Darwin");
201201
cmake_cfg.define("CMAKE_OSX_SYSROOT", "macosx");
202202
}
203+
if target_os().trim() == "tvos" {
204+
cmake_cfg.define("CMAKE_SYSTEM_NAME", "tvOS");
205+
if effective_target().ends_with("-tvos-sim") || target_arch() == "x86_64" {
206+
cmake_cfg.define("CMAKE_OSX_SYSROOT", "appletvsimulator");
207+
} else {
208+
cmake_cfg.define("CMAKE_OSX_SYSROOT", "appletvos");
209+
}
210+
}
203211
}
204212

205213
if target_os() == "android" {

aws-lc-sys/builder/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ fn invoke_external_bindgen(
942942
if let Some(prefix_str) = prefix {
943943
sym_prefix = if target_os().to_lowercase() == "macos"
944944
|| target_os().to_lowercase() == "ios"
945+
|| target_os().to_lowercase() == "tvos"
945946
|| (target_os().to_lowercase() == "windows" && target_arch() == "x86")
946947
{
947948
format!("_{prefix_str}_")

0 commit comments

Comments
 (0)