Skip to content

Commit 66f8efb

Browse files
committed
Add Apple tvOS build option
Signed-off-by: Mateusz Szczygieł <[email protected]>
1 parent 78258d2 commit 66f8efb

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

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
@@ -915,6 +915,7 @@ fn invoke_external_bindgen(
915915
if let Some(prefix_str) = prefix {
916916
sym_prefix = if target_os().to_lowercase() == "macos"
917917
|| target_os().to_lowercase() == "ios"
918+
|| target_os().to_lowercase() == "tvos"
918919
|| (target_os().to_lowercase() == "windows" && target_arch() == "x86")
919920
{
920921
format!("_{prefix_str}_")

0 commit comments

Comments
 (0)