Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/media/libsoundtouch/src/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 3 kB image not shown  

Quelle  moz.build   Sprache: unbekannt

 
Spracherkennung für: .build vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

# -*- 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/.

EXPORTS += [
    "RLBoxSoundTouch.h",
    "RLBoxSoundTouchTypes.h",
]

EXPORTS.soundtouch += [
    'FIFOSamplePipe.h',
    'RLBoxSoundTouchFactory.h',
    'SoundTouch.h',
    'soundtouch_config.h',
    'SoundTouchFactory.h',
    'STTypes.h',
]

LOCAL_INCLUDES += ["!/security/rlbox"]

LOCAL_INCLUDES += [
    "/third_party/simde/",
    "/third_party/wasm2c/wasm2c/",
]

SOURCES += ["RLBoxSoundTouch.cpp"]
# Some xpcom things are #included indirectly (but not actually used), and
# it's simpler to set MOZILLA_INTERNAL_API to make it compile than to
# disentangle the whole thing.
SOURCES["RLBoxSoundTouch.cpp"].flags += ["-DMOZILLA_INTERNAL_API"]

if CONFIG["MOZ_WASM_SANDBOXING_SOUNDTOUCH"]:
    include("/security/rlbox/rlbox.mozbuild")

    # Disabling Segue as other rlboxed libraries (the non-GPL rlboxed libraries)
    # use Segue under the assumption that they have exclusive use of the segment
    # register. This assumption speeds up the rlboxed libraries significantly.
    # However, it does mean that the below rlboxed library can either avoid
    # Segue or use Segue with non-exclusive segment use. We opt for disabling
    # Segue since Segue with non-exclusive segment use can introduce some extra
    # costs when invoking functions in the library.
    RLBoxLibrary("rlboxsoundtouch", use_segue=False)

    DEFINES["WASM_RT_GROW_FAILED_CRASH"] = True

    SOURCES += [
        "/config/external/rlbox_wasm2c_sandbox/rlbox_wasm2c_thread_locals.cpp",
        "/third_party/rlbox_wasm2c_sandbox/src/wasm2c_rt_mem.c",
        "/third_party/rlbox_wasm2c_sandbox/src/wasm2c_rt_minwasi.c",
    ]
    if CONFIG['OS_ARCH'] != 'WINNT':
        OS_LIBS += ["m"]

    if CONFIG["MOZ_SAMPLE_TYPE_FLOAT32"]:
        WASM_DEFINES["MOZ_SAMPLE_TYPE_FLOAT32"] = 1

        # Clang older than version 14 does not have the necessary
        # WASMSIMD intrinsics, so we disable SoundTouch WASMSIMD.
        # See Bug 1851301
        if int(CONFIG["WASM_CC_VERSION"].split(".")[0]) > 13:
            WASM_SOURCES += ['sse_optimized.cpp']

            WASM_DEFINES["SOUNDTOUCH_ALLOW_SSE"] = 1
            WASM_DEFINES["SOUNDTOUCH_WASM_SIMD"] = 1
            WASM_DEFINES["SIMDE_ENABLE_NATIVE_ALIASES"] = 1

    soundtouch_sources = WASM_SOURCES
    soundtouch_defines = WASM_DEFINES

else:
    SOURCES += ["/config/external/rlbox/rlbox_thread_locals.cpp"]
    if CONFIG['INTEL_ARCHITECTURE']:
        if CONFIG['MOZ_SAMPLE_TYPE_FLOAT32']:
            SOURCES += ['sse_optimized.cpp']
            SOURCES['sse_optimized.cpp'].flags += CONFIG['SSE2_FLAGS']
        else:
            SOURCES += ['mmx_optimized.cpp']
            SOURCES['mmx_optimized.cpp'].flags += CONFIG['MMX_FLAGS']

    if CONFIG['OS_ARCH'] != 'WINNT':
        # GCC/Clang require permissions to be explicitly set for the soundtouch
        # header.
        CXXFLAGS += ['-include', SRCDIR + '/soundtouch_perms.h']
    else:
        # Windows need alloca renamed to _alloca
        DEFINES['alloca'] = '_alloca'

    soundtouch_sources = UNIFIED_SOURCES
    soundtouch_defines = DEFINES

soundtouch_sources += [
    'AAFilter.cpp',
    'cpu_detect_x86.cpp',
    'FIFOSampleBuffer.cpp',
    'FIRFilter.cpp',
    'InterpolateCubic.cpp',
    'InterpolateLinear.cpp',
    'InterpolateShannon.cpp',
    'RateTransposer.cpp',
    'RLBoxSoundTouchFactory.cpp',
    'SoundTouch.cpp',
    'SoundTouchFactory.cpp',
    'TDStretch.cpp',
]

for k, v in (
    ('BUILDING_SOUNDTOUCH', 1),
    # Use abort() instead of exception in SoundTouch.
    ('ST_NO_EXCEPTION_HANDLING', 1)
):
    soundtouch_defines[k] = v


# We allow warnings for third-party code that can be updated from upstream.
AllowCompilerWarnings()

FINAL_LIBRARY = 'lgpllibs'

[ Dauer der Verarbeitung: 0.37 Sekunden  ]