gecko-dev/media/libpng/moz.build
Mike Hommey 2fddbb74c5 Bug 1840537 - Enable value checking in moz.build for CONFIG variables derived from target.*. r=firefox-build-system-reviewers,andi,sergesanspaille
This makes the types from mozbuild.configure.constants repr()-able, and
repr()-ed in config.status, which, when processing moz.build, translates
into value checking for comparison tests involving the variables.

To make them pickable, though, we replace the use of EnumString.subclass
with actual subclassing, which is a little less convenient, but avoids
having to figure out how to make the classes EnumString.subclass creates
pickable.

This caught some mismatches in media/libpng and third_party/libsrtp.

This also means we don't need to normalize the config before dumping it
in config.status, because the only types that this was actually useful
for are these (historically, we'd also turn byte strings into unicode
strings but that hasn't been a thing for 4 years ; the special treatment
of dicts and iterables was there to apply the normalization recursively,
not to normalize dicts and iterables themselves). We still normalization
before passing values to gyp, though.

Differential Revision: https://phabricator.services.mozilla.com/D182141
2023-07-06 21:33:41 +00:00

79 lines
1.8 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Core", "Graphics: ImageLib")
EXPORTS += [
'png.h',
'pngconf.h',
'pnglibconf.h'
]
UNIFIED_SOURCES += [
'png.c',
'pngerror.c',
'pngget.c',
'pngmem.c',
'pngpread.c',
'pngread.c',
'pngrio.c',
'pngrtran.c',
'pngrutil.c',
'pngset.c',
'pngtrans.c',
'pngwio.c',
'pngwrite.c',
'pngwutil.c'
]
if CONFIG['CPU_ARCH'] == 'arm' or CONFIG['CPU_ARCH'] == 'aarch64':
DEFINES['MOZ_PNG_USE_ARM_NEON'] = True
UNIFIED_SOURCES += [
'arm/arm_init.c',
'arm/filter_neon_intrinsics.c',
'arm/palette_neon_intrinsics.c'
]
if CONFIG['CPU_ARCH'] == 'arm':
SOURCES += [
'arm/filter_neon.S'
]
if CONFIG['INTEL_ARCHITECTURE']:
DEFINES['MOZ_PNG_USE_INTEL_SSE'] = True
UNIFIED_SOURCES += [
'intel/filter_sse2_intrinsics.c',
'intel/intel_init.c'
]
if CONFIG['CPU_ARCH'] in ('mips32', 'mips64'):
DEFINES['MOZ_PNG_USE_MIPS_MSA'] = True
UNIFIED_SOURCES += [
'mips/filter_msa_intrinsics.c',
'mips/mips_init.c'
]
if CONFIG['HAVE_ALTIVEC']:
DEFINES['MOZ_PNG_USE_POWERPC'] = True
UNIFIED_SOURCES += [
'powerpc/filter_vsx_intrinsics.c',
'powerpc/powerpc_init.c'
]
if CONFIG['MOZ_TREE_FREETYPE']:
DEFINES['FT_CONFIG_OPTION_USE_PNG'] = True
Library('mozpng')
FINAL_LIBRARY = 'gkmedias'
# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CFLAGS += ['-std=gnu89']