update build for Apple Silicon
You can use this to cross complie from an x86_64 mac if you have at least XCode12 beta 2 installed, and you set target_cpu = "arm64" in your gn args. Change-Id: I3fcdcd162155ac0242c15260994de09177ff2f97 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328659 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
This commit is contained in:
parent
4195bcc25a
commit
7e581790bf
17
gn/BUILD.gn
17
gn/BUILD.gn
@ -254,6 +254,23 @@ config("default") {
|
||||
# /System/Library/Frameworks/foo.framework/foo are out of sync.
|
||||
# Falling back to library file for linking.
|
||||
ldflags += [ "-Wl,-w" ]
|
||||
|
||||
# As of 11/2020, gn is an x86 binary and defaults the host_cpu to x86_64.
|
||||
# This allows you to build arm64 mac binaries by setting target_cpu = "arm64"
|
||||
if (current_cpu == "arm64") {
|
||||
asmflags += [
|
||||
"-target",
|
||||
"arm64-apple-macos11",
|
||||
]
|
||||
cflags += [
|
||||
"-target",
|
||||
"arm64-apple-macos11",
|
||||
]
|
||||
ldflags += [
|
||||
"-target",
|
||||
"arm64-apple-macos11",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (sanitize != "" && sanitize != "MSVC") {
|
||||
|
2
third_party/libjpeg-turbo/BUILD.gn
vendored
2
third_party/libjpeg-turbo/BUILD.gn
vendored
@ -95,7 +95,7 @@ if (skia_use_system_libjpeg_turbo) {
|
||||
"../externals/libjpeg-turbo/simd/arm/common/jidctint-neon.c",
|
||||
"../externals/libjpeg-turbo/simd/arm/common/jidctred-neon.c",
|
||||
]
|
||||
} else if (current_cpu == "arm64" && !is_ios && !is_win) {
|
||||
} else if (current_cpu == "arm64" && !is_mac && !is_ios && !is_win) {
|
||||
sources += [
|
||||
"../externals/libjpeg-turbo/simd/arm/arm64/jsimd.c",
|
||||
"../externals/libjpeg-turbo/simd/arm/arm64/jsimd_neon.S",
|
||||
|
2
third_party/zlib/BUILD.gn
vendored
2
third_party/zlib/BUILD.gn
vendored
@ -40,7 +40,7 @@ if (skia_use_system_zlib) {
|
||||
defines += [ "ARMV8_OS_FUCHSIA" ]
|
||||
} else if (is_win) {
|
||||
defines += [ "ARMV8_OS_WINDOWS" ]
|
||||
} else if (is_ios) {
|
||||
} else if (is_ios || is_mac) {
|
||||
# iOS@ARM is a special case where we always have NEON but don't check
|
||||
# for crypto extensions.
|
||||
defines += [ "ARM_OS_IOS" ]
|
||||
|
Loading…
Reference in New Issue
Block a user