tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ffvpxcommon.mozbuild (2602B)


      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 # Add assembler flags and includes
      8 if CONFIG['TARGET_CPU'] != 'aarch64':
      9     ASFLAGS += CONFIG['FFVPX_ASFLAGS']
     10     ASFLAGS += ['-I%s/media/ffvpx/' % TOPSRCDIR]
     11     ASFLAGS += ['-I%s/media/ffvpx/libavcodec/x86/' % TOPSRCDIR]
     12     ASFLAGS += ['-I%s/media/ffvpx/libavutil/x86/' % TOPSRCDIR]
     13 
     14 if CONFIG['FFVPX_ASFLAGS']:
     15     if CONFIG['FFVPX_USE_NASM']:
     16         USE_NASM = True
     17 
     18     if CONFIG['OS_ARCH'] == 'WINNT':
     19        # Fix inline symbols and math defines for windows.
     20         DEFINES['_USE_MATH_DEFINES'] = True
     21         DEFINES['inline'] = "__inline"
     22 
     23 LOCAL_INCLUDES += ['/media/ffvpx']
     24 
     25 USE_LIBS += [ 'gkcodecs' ]
     26 
     27 # We allow warnings for third-party code that can be updated from upstream.
     28 AllowCompilerWarnings()
     29 
     30 # Suppress warnings in third-party code.
     31 CFLAGS += [
     32     '-Wno-parentheses',
     33     '-Wno-pointer-sign',
     34     '-Wno-sign-compare',
     35     '-Wno-switch',
     36     '-Wno-type-limits',
     37     '-Wno-unused-function',
     38     # XXX This does not seem to have any effect on some versions of GCC.
     39     '-Wno-deprecated-declarations',
     40 ]
     41 if CONFIG['CC_TYPE'] in ('clang', 'clang-cl'):
     42     CFLAGS += [
     43         '-Wno-absolute-value',
     44         '-Wno-incompatible-pointer-types',
     45         '-Wno-string-conversion',
     46         '-Wno-visibility',
     47     ]
     48     if CONFIG['CC_TYPE'] == 'clang-cl':
     49         CFLAGS += [
     50             '-Wno-inconsistent-dllimport',
     51             '-Wno-macro-redefined', # 'WIN32_LEAN_AND_MEAN' macro redefined
     52         ]
     53 else:
     54     CFLAGS += [
     55         '-Wno-discarded-qualifiers',
     56         '-Wno-maybe-uninitialized',
     57     ]
     58 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     59     # Force visibility of cpu and av_log symbols.
     60     CFLAGS += ['-include', 'libavutil_visibility.h']
     61 if CONFIG['CC_TYPE'] == 'clang-cl':
     62     LOCAL_INCLUDES += ['/media/ffvpx/compat/atomics/win32']
     63 DEFINES['HAVE_AV_CONFIG_H'] = True
     64 
     65 if CONFIG['CC_TYPE'] == 'clang':
     66   CXXFLAGS += [
     67       '-Wsometimes-uninitialized',
     68       '-Wunreachable-code-return',
     69       '-Wunreachable-code',
     70       '-Wunused-const-variable',
     71   ]
     72 
     73 if CONFIG['MOZ_DEBUG']:
     74     # Enable all assertions in debug builds.
     75     DEFINES['ASSERT_LEVEL'] = 2
     76 elif not CONFIG['RELEASE_OR_BETA']:
     77     # Enable fast assertions in opt builds of Nightly and Aurora.
     78     DEFINES['ASSERT_LEVEL'] = 1
     79 
     80 # Add libFuzzer configuration directives
     81 include('/tools/fuzzing/libfuzzer-config.mozbuild')