summaryrefslogtreecommitdiff
path: root/BUILD.gn
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2024-01-16 19:49:04 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2024-01-16 19:49:04 +0000
commit8dfcd22af5ffad0e16ec1023d0a189afd39c9b21 (patch)
tree5c22f49fb49d4d79d2934c8e4597039c264aad45 /BUILD.gn
parente39eef61c2788eeb438f1e21601df32db6e95de4 (diff)
parent2581195c8f488e3fd47e686e8e1f0638c132ba11 (diff)
downloadzlib-8dfcd22af5ffad0e16ec1023d0a189afd39c9b21.tar.gz
Merge "Upgrade zlib to 40e35a76af71511ee701001df5bc1ba216472d67" into main
Diffstat (limited to 'BUILD.gn')
-rw-r--r--BUILD.gn74
1 files changed, 34 insertions, 40 deletions
diff --git a/BUILD.gn b/BUILD.gn
index 0ffd486..46627bc 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//build/config/compiler/compiler.gni")
+import("//build/config/dcheck_always_on.gni")
declare_args() {
# Expose zlib's symbols, used by Node.js to provide zlib APIs for its native
@@ -33,7 +34,7 @@ config("zlib_internal_config") {
# Build code using -O3, see: crbug.com/1084371.
configs = [ "//build/config/compiler:optimize_speed" ]
}
- if (is_debug || use_fuzzing_engine) {
+ if (is_debug || dcheck_always_on || use_fuzzing_engine) {
# Enable zlib's asserts in debug and fuzzer builds.
defines += [ "ZLIB_DEBUG" ]
}
@@ -124,45 +125,40 @@ source_set("zlib_adler32_simd") {
if (use_arm_neon_optimizations) {
config("zlib_arm_crc32_config") {
- # Disabled for iPhone, as described in DDI0487C_a_armv8_arm:
- # "All implementations of the ARMv8.1 architecture are required to
- # implement the CRC32* instructions. These are optional in ARMv8.0."
- if (!is_ios) {
- defines = [ "CRC32_ARMV8_CRC32" ]
- if (is_android) {
- defines += [ "ARMV8_OS_ANDROID" ]
- } else if (is_linux || is_chromeos) {
- defines += [ "ARMV8_OS_LINUX" ]
- } else if (is_mac) {
- defines += [ "ARMV8_OS_MACOS" ]
- } else if (is_fuchsia) {
- defines += [ "ARMV8_OS_FUCHSIA" ]
- } else if (is_win) {
- defines += [ "ARMV8_OS_WINDOWS" ]
- } else {
- assert(false, "Unsupported ARM OS")
- }
+ defines = [ "CRC32_ARMV8_CRC32" ]
+ if (is_android) {
+ defines += [ "ARMV8_OS_ANDROID" ]
+ } else if (is_linux || is_chromeos) {
+ defines += [ "ARMV8_OS_LINUX" ]
+ } else if (is_mac) {
+ defines += [ "ARMV8_OS_MACOS" ]
+ } else if (is_ios) {
+ defines += [ "ARMV8_OS_IOS" ]
+ } else if (is_fuchsia) {
+ defines += [ "ARMV8_OS_FUCHSIA" ]
+ } else if (is_win) {
+ defines += [ "ARMV8_OS_WINDOWS" ]
+ } else {
+ assert(false, "Unsupported ARM OS")
}
}
source_set("zlib_arm_crc32") {
visibility = [ ":*" ]
- if (!is_ios) {
- include_dirs = [ "." ]
-
- if (!is_win && !is_clang) {
- assert(!use_thin_lto,
- "ThinLTO fails mixing different module-level targets")
- cflags_c = [ "-march=armv8-a+aes+crc" ]
- }
+ include_dirs = [ "." ]
- sources = [
- "crc32_simd.c",
- "crc32_simd.h",
- ]
+ if (!is_win && !is_clang) {
+ assert(!use_thin_lto,
+ "ThinLTO fails mixing different module-level targets")
+ cflags_c = [ "-march=armv8-a+aes+crc" ]
}
+ sources = [
+ "crc32_simd.c",
+ "crc32_simd.h",
+ ]
+
configs += [ ":zlib_internal_config" ]
public_configs = [ ":zlib_arm_crc32_config" ]
@@ -332,14 +328,6 @@ component("zlib") {
defines += [ "CPU_NO_SIMD" ]
}
- if (is_ios) {
- # iOS@ARM is a special case where we always have NEON but don't check
- # for crypto extensions.
- # TODO(cavalcantii): verify what is the current state of CPU features
- # shipped on latest iOS devices.
- defines += [ "ARM_OS_IOS" ]
- }
-
if (use_x86_x64_optimizations || use_arm_neon_optimizations) {
deps += [
":zlib_adler32_simd",
@@ -359,7 +347,7 @@ component("zlib") {
if (is_android) {
import("//build/config/android/config.gni")
if (defined(android_ndk_root) && android_ndk_root != "") {
- deps += [ "//third_party/android_ndk:cpu_features" ]
+ deps += [ "//third_party/cpu_features:ndk_compat" ]
} else {
assert(false, "CPU detection requires the Android NDK")
}
@@ -398,6 +386,11 @@ config("minizip_warnings") {
}
static_library("minizip") {
+ include_dirs = [
+ ".",
+ "//third_party/zlib",
+ ]
+
sources = [
"contrib/minizip/ioapi.c",
"contrib/minizip/ioapi.h",
@@ -520,6 +513,7 @@ if (build_with_chromium) {
}
deps = [
+ ":minizip",
":zlib",
"google:compression_utils",
"google:zip",