Commit 0347dc10 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac: enough to make `target_cpu = "arm64"` make it through `gn gen`

Doesn't build at all, but hey, it's a start.

Bug: 1098899
Change-Id: I63500b3650b315c47219614cc9ae9a3ddbcf42c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264499
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#782116}
parent 5fa0ec5f
...@@ -237,7 +237,7 @@ if (target_os == "android") { ...@@ -237,7 +237,7 @@ if (target_os == "android") {
_default_toolchain = "//build/toolchain/mac:ios_clang_$target_cpu" _default_toolchain = "//build/toolchain/mac:ios_clang_$target_cpu"
} else if (target_os == "mac") { } else if (target_os == "mac") {
assert(host_os == "mac", "Mac cross-compiles are unsupported.") assert(host_os == "mac", "Mac cross-compiles are unsupported.")
_default_toolchain = host_toolchain _default_toolchain = "//build/toolchain/mac:clang_$target_cpu"
} else if (target_os == "win") { } else if (target_os == "win") {
# On Windows, we use the same toolchain for host and target by default. # On Windows, we use the same toolchain for host and target by default.
# Beware, win cross builds have some caveats, see docs/win_cross.md # Beware, win cross builds have some caveats, see docs/win_cross.md
...@@ -585,10 +585,9 @@ foreach(_target_type, ...@@ -585,10 +585,9 @@ foreach(_target_type,
# On Android, write shared library output file to metadata. We will use # On Android, write shared library output file to metadata. We will use
# this information to, for instance, collect all shared libraries that # this information to, for instance, collect all shared libraries that
# should be packaged into an APK. # should be packaged into an APK.
if (!defined(invoker.metadata) && is_android && (_target_type == if (!defined(invoker.metadata) && is_android &&
"shared_library" || (_target_type == "shared_library" ||
_target_type == _target_type == "loadable_module")) {
"loadable_module")) {
_output_name = _target_name _output_name = _target_name
if (defined(invoker.output_name)) { if (defined(invoker.output_name)) {
_output_name = invoker.output_name _output_name = invoker.output_name
......
...@@ -24,6 +24,13 @@ config("compiler") { ...@@ -24,6 +24,13 @@ config("compiler") {
"-arch", "-arch",
"i386", "i386",
] ]
} else if (current_cpu == "arm64") {
common_mac_flags += [
"-arch",
current_cpu,
]
} else {
assert(false, "unknown current_cpu $current_cpu")
} }
# This is here so that all files get recompiled after an Xcode update. # This is here so that all files get recompiled after an Xcode update.
......
...@@ -477,6 +477,13 @@ mac_toolchain("clang_arm") { ...@@ -477,6 +477,13 @@ mac_toolchain("clang_arm") {
} }
} }
mac_toolchain("clang_arm64") {
toolchain_args = {
current_cpu = "arm64"
current_os = "mac"
}
}
mac_toolchain("clang_x64") { mac_toolchain("clang_x64") {
toolchain_args = { toolchain_args = {
current_cpu = "x64" current_cpu = "x64"
......
...@@ -90,6 +90,8 @@ if (use_arm_neon_optimizations) { ...@@ -90,6 +90,8 @@ if (use_arm_neon_optimizations) {
defines += [ "ARMV8_OS_ANDROID" ] defines += [ "ARMV8_OS_ANDROID" ]
} else if (is_linux || is_chromeos) { } else if (is_linux || is_chromeos) {
defines += [ "ARMV8_OS_LINUX" ] defines += [ "ARMV8_OS_LINUX" ]
} else if (is_mac) {
defines += [ "ARMV8_OS_MACOS" ]
} else if (is_fuchsia) { } else if (is_fuchsia) {
defines += [ "ARMV8_OS_FUCHSIA" ] defines += [ "ARMV8_OS_FUCHSIA" ]
} else if (is_win) { } else if (is_win) {
......
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