Bug 1845017 - Disable the TestPHCExhaustion test r=glandium
[gecko.git] / media / libtheora / moz.build
blob7e76448db9ca70e32d55f3f91a7b7a24523a8183
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 = 'gkmedias'
20 # The encoder is currently not included.
21 DEFINES['THEORA_DISABLE_ENCODE'] = True
23 # Suppress warnings in third-party code.
24 CFLAGS += ['-Wno-type-limits']
25 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
26     CFLAGS += [
27         '-Wno-shift-negative-value',
28         '-Wno-tautological-compare',
29     ]
30 if CONFIG['CC_TYPE'] == 'clang-cl':
31     CFLAGS += [
32         '-Wno-parentheses',
33         '-Wno-pointer-sign',
34     ]
36 UNIFIED_SOURCES += [
37     'lib/bitpack.c',
38     'lib/decinfo.c',
39     'lib/decode.c',
40     'lib/dequant.c',
41     'lib/fragment.c',
42     'lib/huffdec.c',
43     'lib/idct.c',
44     'lib/info.c',
45     'lib/internal.c',
46     'lib/quant.c',
47     'lib/state.c',
50 LOCAL_INCLUDES += ['include']
52 if CONFIG['INTEL_ARCHITECTURE']:
53     if CONFIG['OS_ARCH'] != 'SunOS':
54         if CONFIG['CC_TYPE'] == 'clang-cl':
55             # clang-cl can't handle libtheora's inline asm.
56             pass
57         elif CONFIG['OS_ARCH'] != 'WINNT' or CONFIG['CPU_ARCH'] != 'x86_64':
58             DEFINES['OC_X86_ASM'] = True
59             if CONFIG['CPU_ARCH'] == 'x86_64':
60                 DEFINES['OC_X86_64_ASM'] = True
61     if CONFIG['CC_TYPE'] == 'clang-cl':
62         # clang-cl can't handle libtheora's inline asm.
63         pass
64         #SOURCES += [
65         #    'lib/x86_vc/mmxfrag.c',
66         #    'lib/x86_vc/mmxidct.c',
67         #    'lib/x86_vc/mmxstate.c',
68         #    'lib/x86_vc/x86cpu.c',
69         #    'lib/x86_vc/x86state.c',
70         #]
71     else:
72         SOURCES += [
73             'lib/x86/mmxfrag.c',
74             'lib/x86/mmxidct.c',
75             'lib/x86/mmxstate.c',
76             'lib/x86/sse2idct.c',
77             'lib/x86/x86cpu.c',
78             'lib/x86/x86state.c',
79         ]
81 if CONFIG['GNU_AS']:
82     if CONFIG['CPU_ARCH'] == 'arm':
83         SOURCES += [
84             'lib/arm/armcpu.c',
85             'lib/arm/armstate.c',
86         ]
87         for var in ('OC_ARM_ASM',
88                     'OC_ARM_ASM_EDSP',
89                     'OC_ARM_ASM_MEDIA',
90                     'OC_ARM_ASM_NEON'):
91             DEFINES[var] = True
93         SOURCES += [ '!%s.s' % f for f in [
94             'armbits-gnu',
95             'armfrag-gnu',
96             'armidct-gnu',
97             'armloop-gnu',
98         ]]
100         # These flags are a lie; they're just used to enable the requisite
101         # opcodes; actual arch detection is done at runtime.
102         ASFLAGS += [
103             '-march=armv7-a',
104         ]
105         ASFLAGS += CONFIG['NEON_FLAGS']