Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / media / libtheora / moz.build
blob5e44d36ec8cde8a92569ec9190d1b26c91caec4e
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/.
7 with Files('*'):
8     BUG_COMPONENT = ('Core', 'Audio/Video')
10 EXPORTS.theora += [
11     'include/theora/codec.h',
12     'include/theora/theoradec.h',
15 # We allow warnings for third-party code that can be updated from upstream.
16 AllowCompilerWarnings()
18 FINAL_LIBRARY = 'gkcodecs'
19 NoVisibilityFlags()
21 # The encoder is currently not included.
22 DEFINES['THEORA_DISABLE_ENCODE'] = True
24 # Suppress warnings in third-party code.
25 CFLAGS += ['-Wno-type-limits']
26 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
27     CFLAGS += [
28         '-Wno-shift-negative-value',
29         '-Wno-tautological-compare',
30     ]
31 if CONFIG['CC_TYPE'] == 'clang-cl':
32     CFLAGS += [
33         '-Wno-parentheses',
34         '-Wno-pointer-sign',
35     ]
37 UNIFIED_SOURCES += [
38     'lib/bitpack.c',
39     'lib/decinfo.c',
40     'lib/decode.c',
41     'lib/dequant.c',
42     'lib/fragment.c',
43     'lib/huffdec.c',
44     'lib/idct.c',
45     'lib/info.c',
46     'lib/internal.c',
47     'lib/quant.c',
48     'lib/state.c',
51 LOCAL_INCLUDES += ['include']
53 if CONFIG['INTEL_ARCHITECTURE']:
54     if CONFIG['OS_ARCH'] != 'SunOS':
55         if CONFIG['CC_TYPE'] == 'clang-cl':
56             # clang-cl can't handle libtheora's inline asm.
57             pass
58         elif CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['CPU_ARCH'] != 'x86_64':
59             DEFINES['OC_X86_ASM'] = True
60             if CONFIG['CPU_ARCH'] == 'x86_64':
61                 DEFINES['OC_X86_64_ASM'] = True
62     if CONFIG['CC_TYPE'] == 'clang-cl':
63         # clang-cl can't handle libtheora's inline asm.
64         pass
65         #SOURCES += [
66         #    'lib/x86_vc/mmxfrag.c',
67         #    'lib/x86_vc/mmxidct.c',
68         #    'lib/x86_vc/mmxstate.c',
69         #    'lib/x86_vc/x86cpu.c',
70         #    'lib/x86_vc/x86state.c',
71         #]
72     else:
73         SOURCES += [
74             'lib/x86/mmxfrag.c',
75             'lib/x86/mmxidct.c',
76             'lib/x86/mmxstate.c',
77             'lib/x86/sse2idct.c',
78             'lib/x86/x86cpu.c',
79             'lib/x86/x86state.c',
80         ]
82 if CONFIG['GNU_AS']:
83     if CONFIG['CPU_ARCH'] == 'arm':
84         SOURCES += [
85             'lib/arm/armcpu.c',
86             'lib/arm/armstate.c',
87         ]
88         for var in ('OC_ARM_ASM',
89                     'OC_ARM_ASM_EDSP',
90                     'OC_ARM_ASM_MEDIA',
91                     'OC_ARM_ASM_NEON'):
92             DEFINES[var] = True
94         SOURCES += [ '!%s.s' % f for f in [
95             'armbits-gnu',
96             'armfrag-gnu',
97             'armidct-gnu',
98             'armloop-gnu',
99         ]]
101         # These flags are a lie; they're just used to enable the requisite
102         # opcodes; actual arch detection is done at runtime.
103         ASFLAGS += [
104             '-march=armv7-a',
105         ]
106         ASFLAGS += CONFIG['NEON_FLAGS']