From 80d285c4804d7217cdadc7da20922b3d30eca641 Mon Sep 17 00:00:00 2001 From: Chun-Min Chang Date: Tue, 5 Dec 2023 20:08:21 +0000 Subject: [PATCH] Bug 1864008 - Build libvpx with platform-specific vpx_config.c r=media-playback-reviewers,glandium,karlt This patch brings the platform-specific `vpx_codec_build_config` implementation into libvpx since it will be used and exposed in the following patches. Differential Revision: https://phabricator.services.mozilla.com/D193598 --- media/libvpx/generate_sources_mozbuild.sh | 1 + media/libvpx/moz.build | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/media/libvpx/generate_sources_mozbuild.sh b/media/libvpx/generate_sources_mozbuild.sh index f2bab8afab2d..ef9bc696f30d 100755 --- a/media/libvpx/generate_sources_mozbuild.sh +++ b/media/libvpx/generate_sources_mozbuild.sh @@ -77,6 +77,7 @@ function convert_srcs_to_project_files { local source_list=$(grep -E '(\.c|\.h|\.S|\.s|\.asm)$' $1) # Remove vpx_config.c. + # The platform-specific vpx_config.c will be added into in moz.build later. source_list=$(echo "$source_list" | grep -v 'vpx_config\.c') # Remove include-only asm files (no object code emitted) diff --git a/media/libvpx/moz.build b/media/libvpx/moz.build index 388f55cc3f11..c4562867a99a 100644 --- a/media/libvpx/moz.build +++ b/media/libvpx/moz.build @@ -19,24 +19,30 @@ if CONFIG['CPU_ARCH'] == 'x86_64': if CONFIG['OS_TARGET'] == 'WINNT': ASFLAGS += [ '-I%s/media/libvpx/config/win/x64/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/win/x64/' ] + SOURCES += [ '/media/libvpx/config/win/x64/vpx_config.c' ] elif CONFIG['OS_TARGET'] == 'Darwin': ASFLAGS += [ '-I%s/media/libvpx/config/mac/x64/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/mac/x64/' ] + SOURCES += [ '/media/libvpx/config/mac/x64/vpx_config.c' ] else: # Android, Linux, BSDs, etc. ASFLAGS += [ '-I%s/media/libvpx/config/linux/x64/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/linux/x64/' ] + SOURCES += [ '/media/libvpx/config/linux/x64/vpx_config.c' ] elif CONFIG['CPU_ARCH'] == 'x86': EXPORTS.vpx += files['IA32_EXPORTS'] SOURCES += files['IA32_SOURCES'] if CONFIG['OS_TARGET'] == 'WINNT': ASFLAGS += [ '-I%s/media/libvpx/config/win/ia32/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/win/ia32/' ] + SOURCES += [ '/media/libvpx/config/win/ia32/vpx_config.c' ] elif CONFIG['OS_TARGET'] == 'Darwin': ASFLAGS += [ '-I%s/media/libvpx/config/mac/ia32/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/mac/ia32/' ] + SOURCES += [ '/media/libvpx/config/mac/ia32/vpx_config.c' ] else: # Android, Linux, BSDs, etc. ASFLAGS += [ '-I%s/media/libvpx/config/linux/ia32/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/linux/ia32/' ] + SOURCES += [ '/media/libvpx/config/linux/ia32/vpx_config.c' ] elif CONFIG['CPU_ARCH'] == 'arm': EXPORTS.vpx += files['ARM_EXPORTS'] ASFLAGS += [ @@ -44,6 +50,7 @@ elif CONFIG['CPU_ARCH'] == 'arm': '-I%s/libvpx' % OBJDIR, ] LOCAL_INCLUDES += [ '/media/libvpx/config/linux/arm/' ] + SOURCES += [ '/media/libvpx/config/linux/arm/vpx_config.c' ] arm_asm_files = files['ARM_SOURCES'] @@ -68,17 +75,20 @@ elif CONFIG['CPU_ARCH'] == 'aarch64' and CONFIG['OS_TARGET'] == 'WINNT': SOURCES += files['ARM64_SOURCES'] ASFLAGS += [ '-I%s/media/libvpx/config/win/aarch64/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/win/aarch64/' ] + SOURCES += [ '/media/libvpx/config/win/aarch64/vpx_config.c' ] elif CONFIG['CPU_ARCH'] == 'aarch64': EXPORTS.vpx += files['ARM64_EXPORTS'] SOURCES += files['ARM64_SOURCES'] ASFLAGS += [ '-I%s/media/libvpx/config/linux/arm64/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/linux/arm64/' ] + SOURCES += [ '/media/libvpx/config/linux/arm64/vpx_config.c' ] else: # Generic C-only configuration EXPORTS.vpx += files['GENERIC_EXPORTS'] SOURCES += files['GENERIC_SOURCES'] ASFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ] LOCAL_INCLUDES += [ '/media/libvpx/config/generic/' ] + SOURCES += [ '/media/libvpx/config/generic/vpx_config.c' ] # We allow warnings for third-party code that can be updated from upstream. AllowCompilerWarnings()