diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cf906e79..97bc67a68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,6 +100,8 @@ jobs: - aarch64-ios - aarch64-ios-sim - x86_64-ios + - aarch64-tvos + - aarch64-tvos-sim - i686-linux - arm-linux - aarch64-linux @@ -159,6 +161,18 @@ jobs: check_only: true custom_env: IPHONEOS_DEPLOYMENT_TARGET: 17.5 + - thing: aarch64-tvos + target: aarch64-apple-tvos + os: macos-latest + check_only: true + custom_env: + TVOS_DEPLOYMENT_TARGET: 17.5 + - thing: aarch64-tvos-sim + target: aarch64-apple-tvos-sim + os: macos-latest + check_only: true + custom_env: + TVOS_DEPLOYMENT_TARGET: 17.5 - thing: i686-linux target: i686-unknown-linux-gnu rust: stable diff --git a/boring-sys/build/main.rs b/boring-sys/build/main.rs index 07d0f1c1f..9e97b764e 100644 --- a/boring-sys/build/main.rs +++ b/boring-sys/build/main.rs @@ -17,7 +17,7 @@ fn should_use_cmake_cross_compilation(config: &Config) -> bool { return false; } match config.target_os.as_str() { - "macos" | "ios" => { + "macos" | "ios" | "tvos" => { // Cross-compiling for Apple platforms on macOS is supported using the normal Xcode // tools, along with the settings from `cmake_params_apple`. !config.host.ends_with("-darwin") @@ -69,6 +69,31 @@ const CMAKE_PARAMS_APPLE: &[(&str, &[(&str, &str)])] = &[ ("CMAKE_MACOSX_BUNDLE", "OFF"), ], ), + // tvOS + ( + "aarch64-apple-tvos", + &[ + ("CMAKE_OSX_ARCHITECTURES", "arm64"), + ("CMAKE_OSX_SYSROOT", "appletvos"), + ("CMAKE_MACOSX_BUNDLE", "OFF"), + ], + ), + ( + "aarch64-apple-tvos-sim", + &[ + ("CMAKE_OSX_ARCHITECTURES", "arm64"), + ("CMAKE_OSX_SYSROOT", "appletvsimulator"), + ("CMAKE_MACOSX_BUNDLE", "OFF"), + ], + ), + ( + "x86_64-apple-tvos", + &[ + ("CMAKE_OSX_ARCHITECTURES", "x86_64"), + ("CMAKE_OSX_SYSROOT", "appletvsimulator"), + ("CMAKE_MACOSX_BUNDLE", "OFF"), + ], + ), // macOS ( "aarch64-apple-darwin", @@ -308,6 +333,15 @@ fn get_boringssl_cmake_config(config: &Config) -> cmake::Config { boringssl_cmake.cflag(&cflag); } + "tvos" => { + // Unlike the `ios` arm above, no bitcode flag: bitcode was deprecated in + // Xcode 14 and the tvOS targets postdate it, so the SDK never wants it. + for (name, value) in cmake_params_apple(config) { + eprintln!("tvos arch={} add {}={}", config.target_arch, name, value); + boringssl_cmake.define(name, value); + } + } + "windows" if config.host.contains("windows") => { // BoringSSL's CMakeLists.txt isn't set up for cross-compiling using Visual Studio. // Disable assembly support so that it at least builds. @@ -391,7 +425,7 @@ fn get_extra_clang_args_for_bindgen(config: &Config) -> Vec { // Add platform-specific parameters. match &*config.target_os { - "ios" | "macos" => { + "ios" | "macos" | "tvos" => { // When cross-compiling for Apple targets, tell bindgen to use SDK sysroot, // and *don't* use system headers of the host macOS. let sdk = get_apple_sdk_name(config); @@ -589,7 +623,7 @@ fn get_cpp_runtime_lib(config: &Config) -> Option { } match &*config.target_os { - "macos" | "ios" | "freebsd" | "openbsd" | "android" => Some("c++".into()), + "macos" | "ios" | "tvos" | "freebsd" | "openbsd" | "android" => Some("c++".into()), _ if config.unix || config.target_env == "gnu" => Some("stdc++".into()), // TODO(rmehra): figure out how to do this for windows _ => None,