Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
- aarch64-ios
- aarch64-ios-sim
- x86_64-ios
- aarch64-tvos
- aarch64-tvos-sim
- i686-linux
- arm-linux
- aarch64-linux
Expand Down Expand Up @@ -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
Expand Down
40 changes: 37 additions & 3 deletions boring-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -391,7 +425,7 @@ fn get_extra_clang_args_for_bindgen(config: &Config) -> Vec<String> {

// 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);
Expand Down Expand Up @@ -589,7 +623,7 @@ fn get_cpp_runtime_lib(config: &Config) -> Option<String> {
}

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,
Expand Down
Loading