Commit 98a32fc7 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios/mac/nacl] Disable NaCL on host when targeting iOS

When targeting iOS, the host platform is macOS but only tools are
built, so unconditionally disable nacl for both the target and the
host (i.e. check target_os instead of is_ios).

Also move the check for compatibility between the version of the
OS used for the build and NaCL from build/config/mac/mac_sdk.gni
to components/nacl/features.gni (the error is specific to NaCL,
not to any project that want to reuse Chrome build system).

Bug: 1049832
Change-Id: Id8efb5b4b271a7a6164333efc09f24804564c7a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2088102
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#747235}
parent d7264e83
...@@ -6,7 +6,6 @@ import("//build/config/chrome_build.gni") ...@@ -6,7 +6,6 @@ import("//build/config/chrome_build.gni")
import("//build/config/mac/mac_sdk_overrides.gni") import("//build/config/mac/mac_sdk_overrides.gni")
import("//build/toolchain/goma.gni") import("//build/toolchain/goma.gni")
import("//build/toolchain/toolchain.gni") import("//build/toolchain/toolchain.gni")
import("//components/nacl/features.gni")
declare_args() { declare_args() {
# The MACOSX_DEPLOYMENT_TARGET variable used when compiling. This partially # The MACOSX_DEPLOYMENT_TARGET variable used when compiling. This partially
...@@ -150,17 +149,3 @@ if (mac_sdk_version != mac_sdk_min && ...@@ -150,17 +149,3 @@ if (mac_sdk_version != mac_sdk_min &&
"********************************************************************************") "********************************************************************************")
assert(false, "SDK is incompatible with Xcode") assert(false, "SDK is incompatible with Xcode")
} }
if (enable_nacl && machine_os_build_major >= 19) {
print(
"********************************************************************************")
print(
" WARNING: The NaCL SDK is 32-bit only. macOS 10.15+ removed support for 32-bit")
print(
" executables. To fix, set enable_nacl=false in args.gn, or downgrade to")
print(
" macOS 10.14. For more information, see https://crbug.com/1049832.")
print(
"********************************************************************************")
assert(false, "NaCL SDK is incompatible with host macOS version")
}
...@@ -5,12 +5,16 @@ ...@@ -5,12 +5,16 @@
import("//build/config/chromecast_build.gni") import("//build/config/chromecast_build.gni")
import("//build/config/gclient_args.gni") import("//build/config/gclient_args.gni")
if (is_mac) {
import("//build/config/mac/mac_sdk.gni")
}
declare_args() { declare_args() {
# Enables Native Client support. # Enables Native Client support.
# Temporarily disable nacl on arm64 linux to get rid of compilation errors. # Temporarily disable nacl on arm64 linux to get rid of compilation errors.
# TODO: When mipsel-nacl-clang is available, drop the exclusion. # TODO: When mipsel-nacl-clang is available, drop the exclusion.
enable_nacl = enable_nacl =
checkout_nacl && !is_ios && !is_android && !is_fuchsia && checkout_nacl && target_os != "ios" && !is_android && !is_fuchsia &&
!is_chromecast && current_cpu != "mipsel" && current_cpu != "mips64el" && !is_chromecast && current_cpu != "mipsel" && current_cpu != "mips64el" &&
target_cpu != "arm64" && !(is_win && host_os != "win") target_cpu != "arm64" && !(is_win && host_os != "win")
...@@ -21,3 +25,17 @@ declare_args() { ...@@ -21,3 +25,17 @@ declare_args() {
assert(!(is_win && host_os != "win") || !enable_nacl, assert(!(is_win && host_os != "win") || !enable_nacl,
"NaCl doesn't work in win cross builds, crbug.com/774186") "NaCl doesn't work in win cross builds, crbug.com/774186")
assert(!enable_nacl || checkout_nacl) assert(!enable_nacl || checkout_nacl)
if (is_mac && enable_nacl && machine_os_build_major >= 19) {
print(
"********************************************************************************")
print(
" WARNING: The NaCL SDK is 32-bit only. macOS 10.15+ removed support for 32-bit")
print(
" executables. To fix, set enable_nacl=false in args.gn, or downgrade to")
print(
" macOS 10.14. For more information, see https://crbug.com/1049832.")
print(
"********************************************************************************")
assert(false, "NaCL SDK is incompatible with host macOS version")
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment