moz.build (4181B)
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- 2 # vim: set filetype=python: 3 # This Source Code Form is subject to the terms of the Mozilla Public 4 # License, v. 2.0. If a copy of the MPL was not distributed with this 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 6 7 EXPORTS += [ 8 'pixman-version.h', 9 'pixman.h', 10 ] 11 12 SOURCES += [ 13 'pixman-access-accessors.c', 14 'pixman-access.c', 15 'pixman-arm.c', 16 'pixman-bits-image.c', 17 'pixman-combine-float.c', 18 'pixman-combine32.c', 19 'pixman-conical-gradient.c', 20 'pixman-edge-accessors.c', 21 'pixman-edge.c', 22 'pixman-fast-path.c', 23 'pixman-filter.c', 24 'pixman-general.c', 25 'pixman-glyph.c', 26 'pixman-gradient-walker.c', 27 'pixman-image.c', 28 'pixman-implementation.c', 29 'pixman-linear-gradient.c', 30 'pixman-matrix.c', 31 'pixman-mips.c', 32 'pixman-noop.c', 33 'pixman-ppc.c', 34 'pixman-radial-gradient.c', 35 'pixman-region16.c', 36 'pixman-region32.c', 37 'pixman-region64f.c', 38 'pixman-riscv.c', 39 'pixman-solid-fill.c', 40 'pixman-trap.c', 41 'pixman-utils.c', 42 'pixman-x86.c', 43 'pixman.c', 44 ] 45 46 # We allow warnings for third-party code that can be updated from upstream. 47 AllowCompilerWarnings() 48 49 FINAL_LIBRARY = 'xul' 50 LOCAL_INCLUDES += [ 51 '../../cairo/src', 52 ] 53 54 if CONFIG['MOZ_USE_PTHREADS']: 55 DEFINES['HAVE_PTHREADS'] = True 56 57 DEFINES['PACKAGE'] = 'mozpixman' 58 59 if CONFIG['INTEL_ARCHITECTURE']: 60 DEFINES['USE_X86_MMX'] = True 61 DEFINES['USE_SSE2'] = True 62 DEFINES['USE_SSSE3'] = True 63 SOURCES += [ 64 'pixman-mmx.c', 65 'pixman-sse2.c', 66 'pixman-ssse3.c', 67 ] 68 SOURCES['pixman-mmx.c'].flags += CONFIG['MMX_FLAGS'] 69 SOURCES['pixman-sse2.c'].flags += CONFIG['SSE_FLAGS'] + CONFIG['SSE2_FLAGS'] 70 SOURCES['pixman-ssse3.c'].flags += CONFIG['SSSE3_FLAGS'] 71 # AArch64 NEON optimizations don't build on Windows and Mac out of the box. 72 elif CONFIG['TARGET_CPU'] == 'aarch64' and CONFIG['OS_TARGET'] in ('Android', 'Linux', 'Darwin'): 73 DEFINES['USE_ARM_A64_NEON'] = True 74 if CONFIG['OS_TARGET'] == 'Darwin': 75 DEFINES['ASM_LEADING_UNDERSCORE'] = True 76 SOURCES += [ 77 'pixman-arm-neon.c', 78 'pixman-arma64-neon-asm-bilinear.S', 79 'pixman-arma64-neon-asm.S', 80 ] 81 SOURCES['pixman-arm-neon.c'].flags += ['-march=armv8-a'] 82 elif CONFIG['TARGET_CPU'] == 'arm': 83 if CONFIG['HAVE_ARM_NEON']: 84 DEFINES['USE_ARM_NEON'] = True 85 SOURCES += [ 86 'pixman-arm-neon-asm-bilinear.S', 87 'pixman-arm-neon-asm.S', 88 'pixman-arm-neon.c', 89 ] 90 SOURCES['pixman-arm-neon.c'].flags += CONFIG['NEON_FLAGS'] 91 if CONFIG['HAVE_ARM_SIMD']: 92 DEFINES['USE_ARM_SIMD'] = True 93 SOURCES += [ 94 'pixman-arm-simd-asm-scaled.S', 95 'pixman-arm-simd-asm.S', 96 'pixman-arm-simd.c', 97 ] 98 if CONFIG['HAVE_ARM_NEON'] or CONFIG['HAVE_ARM_SIMD']: 99 DEFINES['ASM_HAVE_SYNTAX_UNIFIED'] = True 100 if CONFIG['OS_TARGET'] == 'Android': 101 # For cpu-features.h 102 LOCAL_INCLUDES += [ 103 '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'] 104 ] 105 SOURCES += [ 106 '%%%s/sources/android/cpufeatures/cpu-features.c' % CONFIG['ANDROID_NDK'], 107 ] 108 elif CONFIG['TARGET_CPU'] in ('ppc', 'ppc64'): 109 if CONFIG['CC_TYPE'] in ('clang', 'gcc'): 110 DEFINES['USE_VMX'] = True 111 SOURCES += ['pixman-vmx.c'] 112 SOURCES['pixman-vmx.c'].flags += ['-maltivec'] 113 114 # Suppress warnings in third-party code. 115 CFLAGS += [ 116 '-Wno-address', 117 '-Wno-braced-scalar-init', 118 '-Wno-missing-field-initializers', 119 '-Wno-sign-compare', 120 '-Wno-incompatible-pointer-types', 121 '-Wno-unused', # too many unused warnings; ignore 122 ] 123 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'): 124 CFLAGS += [ 125 '-Wno-incompatible-pointer-types', 126 '-Wno-tautological-compare', 127 '-Wno-tautological-constant-out-of-range-compare', 128 ] 129 if CONFIG['CC_TYPE'] == 'clang-cl': 130 CFLAGS += [ 131 '-Wno-unused-variable', 132 ] 133 134 # See bug 386897. 135 if CONFIG['OS_TARGET'] == 'Android' and CONFIG['MOZ_OPTIMIZE']: 136 CFLAGS += ['-O2']