media/libpng/moz.build
author Robert Longson <longsonr@gmail.com>
Sat, 04 Feb 2023 15:41:48 +0000
changeset 651752 40237e7707f1928c84d09cdd2f1fd018a74ea784
parent 623548 1c89bb29711d63b6836fd4c75cbceaafea85bce1
permissions -rw-r--r--
Bug 1814872 - Fix degenerate radial gradient handling r=emilio This is a change from SVG 1.1 where we only had to check for r=0 because fr did not exist. The SVG 2 behaviour was clarified in https://github.com/w3c/svgwg/issues/648 Differential Revision: https://phabricator.services.mozilla.com/D168783

# -*- 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'] == 'mips':
    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']