Hash :
73fa1b08
Author :
Date :
2024-02-09T14:38:39
Use -fno-define-target-os-macros for libpng So that https://crrev.com/c/5244629 can roll into ANGLE. Bug: chromium:41492875, angleproject:8524 Change-Id: Id047aa7bbc6846380e770d968a20fbd7d69ab64b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5282082 Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
# Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
config("libpng_config") {
include_dirs = [ "src" ]
cflags = []
if (is_clang) {
cflags += [ "-Wno-tautological-constant-out-of-range-compare" ]
}
if (is_apple) {
# TODO(crbug.com/41492875): this can be removed once libpng is updated to include
# https://github.com/pnggroup/libpng/commit/893b8113f04d408cc6177c6de19c9889a48faa24
cflags += [ "-fno-define-target-os-macros" ]
}
}
static_library("libpng") {
sources = [
"src/png.c",
"src/pngerror.c",
"src/pngget.c",
"src/pngmem.c",
"src/pngpread.c",
"src/pngread.c",
"src/pngrio.c",
"src/pngrtran.c",
"src/pngrutil.c",
"src/pngset.c",
"src/pngtrans.c",
"src/pngwio.c",
"src/pngwrite.c",
"src/pngwtran.c",
"src/pngwutil.c",
]
# Note: currently pnglibconf.h defines this, but if it gets dropped in a
# future roll, needs to be added here for the other defines to work.
# defines = [ "PNG_SET_OPTION_SUPPORTED" ]
if (current_cpu == "x86" || current_cpu == "x64") {
sources += [
"src/intel/filter_sse2_intrinsics.c",
"src/intel/intel_init.c",
]
defines = [ "PNG_INTEL_SSE_OPT=1" ]
} else if (target_cpu == "arm" || target_cpu == "arm64") {
sources += [
"src/arm/arm_init.c",
"src/arm/filter_neon_intrinsics.c",
"src/arm/palette_neon_intrinsics.c",
]
defines = [
"PNG_ARM_NEON_OPT=2",
"PNG_ARM_NEON_IMPLEMENTATION=1",
]
}
if (is_win) {
cflags = [ "/wd4028" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":libpng_config" ]
deps = [ "//third_party/zlib:zlib" ]
}