[pulseaudio-commits] [Git][pulseaudio/webrtc-audio-processing][master] 8 commits: meson: Get rid of cmake and manual library searching
Arun Raghavan (@arun)
gitlab at gitlab.freedesktop.org
Thu May 25 21:51:08 UTC 2023
Arun Raghavan pushed to branch master at PulseAudio / webrtc-audio-processing
Commits:
8366ff0c by Nirbheek Chauhan at 2023-05-26T00:45:00+05:30
meson: Get rid of cmake and manual library searching
Simplify fallback, and prefer it. `[provide]` section requires meson
0.55, so require that.
pkg-config lookup is only provided for distros, since they dislike
static linking / vendoring.
- - - - -
9a362bd1 by Nirbheek Chauhan at 2023-05-26T00:45:29+05:30
meson: Don't require cross files to set host_system = ios
It's not specified as a host_system by meson, so people will often not
set it.
- - - - -
aa32d179 by Nirbheek Chauhan at 2023-05-26T00:45:29+05:30
meson: Update abseil-cpp to latest wrap
- - - - -
4125ace6 by Nirbheek Chauhan at 2023-05-26T03:16:38+05:30
meson: Fix compatibility with Fedora's abseil-cpp package
1. Fedora abseil-cpp package is built with C++17:
https://src.fedoraproject.org/rpms/abseil-cpp/blob/rawhide/f/abseil-cpp.spec
2. There is no `absl_types` pkgconfig file, and it's only needed on iOS
- - - - -
a47df351 by Nirbheek Chauhan at 2023-05-26T03:17:31+05:30
ci: Bump ubuntu version to 22.10
Contains absl with pkgconfig files.
- - - - -
55239c4c by Nirbheek Chauhan at 2023-05-26T03:17:31+05:30
ci: Add jobs for MSVC, macOS, iOS, Android
- - - - -
b24229cb by Nirbheek Chauhan at 2023-05-26T03:17:31+05:30
meson: Ensure that abseil is built with c++17 too
subprojects do not inherit $lang_std default values from the project.
- - - - -
096b0eae by Nirbheek Chauhan at 2023-05-26T03:17:31+05:30
meson: Fixes for MSVC build
winsock2.h must be included before windows.h or alternative
definitions of `struct sockaddr` are defined.
```
FAILED: webrtc/rtc_base/liblibbase.a.p/logging.cc.obj
"cl" "-Iwebrtc\rtc_base\liblibbase.a.p" "-Iwebrtc\rtc_base" "-I..\webrtc\rtc_base" "-Iwebrtc" "-I..\webrtc" "-Isubprojects\abseil-cpp-20230125.1" "-I..\subprojects\abseil-cpp-20230125.1" "/MD" "/nologo" "/showIncludes" "/utf-8" "/Zc:__cplusplus" "/W2" "/EHsc" "/std:c++17" "/permissive-" "/O2" "/Zi" "-DWEBRTC_LIBRARY_
IMPL" "-DWEBRTC_ENABLE_SYMBOL_EXPORT" "-DNDEBUG" "-DWEBRTC_WIN" "-D_WIN32" "-U__STRICT_ANSI__" "-D__STDC_FORMAT_MACROS=1" "-DNOMINMAX" "-DWEBRTC_ENABLE_AVX2" "/Fdwebrtc\rtc_base\liblibbase.a.p\logging.cc.pdb" /Fowebrtc/rtc_base/liblibbase.a.p/logging.cc.obj "/c" ../webrtc/rtc_base/logging.cc
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(457): note: see previous definition of 'AF_IPX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(147): warning C4005: 'AF_MAX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(476): note: see previous definition of 'AF_MAX'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(187): warning C4005: 'SO_DONTLINGER': macro redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(240): error C2011: 'sockaddr': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um\winsock.h(482): note: see declaration of 'sockaddr'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(442): error C2143: syntax error: missing '}' before 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(442): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(496): error C2143: syntax error: missing ';' before '}'
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared\ws2def.h(496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...
```
- - - - -
4 changed files:
- .gitlab-ci.yml
- meson.build
- subprojects/abseil-cpp.wrap
- webrtc/rtc_base/logging.cc
Changes:
=====================================
.gitlab-ci.yml
=====================================
@@ -19,8 +19,8 @@ variables:
# CI runs, for example when adding new packages to FDO_DISTRIBUTION_PACKAGES.
# The tag is an arbitrary string that identifies the exact container
# contents.
- BASE_TAG: '2021-10-19.1'
- FDO_DISTRIBUTION_VERSION: '20.10'
+ BASE_TAG: '2023-05-25.0'
+ FDO_DISTRIBUTION_VERSION: '22.10'
FDO_UPSTREAM_REPO: 'pulseaudio/webrtc-audio-processing'
include:
@@ -83,24 +83,26 @@ build-container-aarch64:
extends:
- .fdo.distribution-image at ubuntu
script:
- - meson build --wrap-mode=nofallback
- - cd build
- - ninja
+ - meson setup --wrap-mode=nofallback builddir
+ - ninja -C builddir
artifacts:
+ expire_in: '5 days'
+ when: 'always'
paths:
- - build/
+ - "builddir/meson-logs/*txt"
.build-vendored-absl:
stage: build
extends:
- .fdo.distribution-image at ubuntu
script:
- - meson build --force-fallback-for=abseil-cpp
- - cd build
- - ninja
+ - meson setup --force-fallback-for=abseil-cpp builddir
+ - ninja -C builddir
artifacts:
+ expire_in: '5 days'
+ when: 'always'
paths:
- - build/
+ - "builddir/meson-logs/*txt"
build-distro-absl-x86_64:
extends:
@@ -121,3 +123,160 @@ build-vendored-absl-aarch64:
extends:
- .build-vendored-absl
- .ubuntu-aarch64
+
+# Update from:
+# https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/main/.gitlab-ci.yml
+# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
+vs2019 amd64:
+ # Update from https://gitlab.freedesktop.org/gstreamer/gstreamer/container_registry
+ image: 'registry.freedesktop.org/gstreamer/gstreamer/amd64/windows:2023-04-21.0-main'
+ stage: 'build'
+ tags:
+ - 'docker'
+ - 'windows'
+ - '2022'
+ artifacts:
+ expire_in: '5 days'
+ when: 'always'
+ paths:
+ - "builddir/meson-logs/*txt"
+ variables:
+ # Make sure any failure in PowerShell scripts is fatal
+ ErrorActionPreference: 'Stop'
+ WarningPreference: 'Stop'
+ ARCH: 'amd64'
+ PLAT: 'Desktop'
+ before_script:
+ # Make sure meson is up to date, so we don't need to rebuild the image with each release
+ - pip3 install -U meson ninja
+ script:
+ # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
+ # Environment variables substitutions is done by PowerShell before calling
+ # cmd.exe, that's why we use $env:FOO instead of %FOO%
+ - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH -app_platform=$env:PLAT &&
+ meson setup builddir &&
+ meson compile --verbose -C builddir"
+
+# Update from:
+# https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/main/.gitlab-ci.yml
+# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
+macos x86_64:
+ stage: 'build'
+ tags:
+ - gst-macos-13
+ artifacts:
+ expire_in: '5 days'
+ when: 'always'
+ paths:
+ - "builddir/meson-logs/*txt"
+ before_script:
+ - pip3 install --upgrade pip
+ # Need to install certificates for python
+ - pip3 install --upgrade certifi
+ # Anther way to install certificates
+ - open /Applications/Python\ 3.8/Install\ Certificates.command
+ # Make sure meson and ninja are up to date
+ - pip3 install -U meson ninja
+ script:
+ - CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
+ - meson setup builddir
+ - meson compile --verbose -C builddir
+
+# Update from:
+# https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/main/.gitlab-ci.yml
+# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
+ios arm64:
+ stage: 'build'
+ tags:
+ - gst-ios-16
+ artifacts:
+ name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
+ expire_in: '5 days'
+ when: 'always'
+ paths:
+ - "builddir/meson-logs/*txt"
+ before_script:
+ - pip3 install --upgrade pip
+ # Need to install certificates for python
+ - pip3 install --upgrade certifi
+ # Anther way to install certificates
+ - open /Applications/Python\ 3.8/Install\ Certificates.command
+ # Make sure meson and ninja are up to date
+ - pip3 install -U meson ninja
+ script:
+ - CERT_PATH=$(python3 -m certifi) && export SSL_CERT_FILE=${CERT_PATH} && export REQUESTS_CA_BUNDLE=${CERT_PATH}
+ - |
+ cat > ios-cross-file.txt <<EOF
+ [host_machine]
+ system = 'darwin'
+ cpu_family = 'aarch64'
+ cpu = 'aarch64'
+ endian = 'little'
+
+ [properties]
+ c_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ objc_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ cpp_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ objcpp_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ c_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ objc_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ cpp_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+ objcpp_link_args = ['-arch', 'arm64', '--sysroot=$(xcrun --sdk iphoneos --show-sdk-path)', '-miphoneos-version-min=8.0']
+
+ [binaries]
+ ar = '$(xcrun --find --sdk iphoneos ar)'
+ c = '$(xcrun --find --sdk iphoneos clang)'
+ objc = '$(xcrun --find --sdk iphoneos clang)'
+ cpp = '$(xcrun --find --sdk iphoneos clang++)'
+ objcpp = '$(xcrun --find --sdk iphoneos clang++)'
+ ranlib = '$(xcrun --find --sdk iphoneos ranlib)'
+ strip = '$(xcrun --find --sdk iphoneos strip)'
+ pkgconfig = 'false'
+ cmake = 'false'
+ EOF
+ - meson setup --cross-file ios-cross-file.txt builddir
+ - meson compile --verbose -C builddir
+
+# Update from:
+# https://gitlab.freedesktop.org/gstreamer/cerbero/-/blob/main/.gitlab-ci.yml
+# https://gitlab.freedesktop.org/gstreamer/orc/-/blob/main/.gitlab-ci.yml
+android fedora arm64:
+ # Update from https://gitlab.freedesktop.org/gstreamer/cerbero/container_registry
+ image: 'registry.freedesktop.org/gstreamer/cerbero/amd64/android-fedora:2021-10-22.0-1.18'
+ stage: 'build'
+ artifacts:
+ expire_in: '5 days'
+ when: 'always'
+ paths:
+ - "builddir/meson-logs/*.txt"
+ before_script:
+ - dnf install -y python3-pip gcc ninja-build
+ - pip3 install --user meson
+ script:
+ - export PATH="$HOME/.local/bin:$PATH"
+ - |
+ cat > android-cross-file.txt <<EOF
+ [constants]
+ ndk_path = '/android/ndk'
+ toolchain = ndk_path + '/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android'
+ api = '28'
+
+ [host_machine]
+ system = 'android'
+ cpu_family = 'aarch64'
+ cpu = 'aarch64'
+ endian = 'little'
+
+ [properties]
+ sys_root = ndk_path + '/sysroot'
+ c_link_args = ['-fuse-ld=gold']
+ cpp_link_args = ['-fuse-ld=gold']
+
+ [binaries]
+ c = toolchain + api + '-clang'
+ cpp = toolchain + api + '-clang++'
+ ar = toolchain + '-ar'
+ strip = toolchain + '-strip'
+ EOF
+ - meson setup --cross-file android-cross-file.txt builddir
+ - meson compile --verbose -C builddir
=====================================
meson.build
=====================================
@@ -1,10 +1,10 @@
project('webrtc-audio-processing', 'c', 'cpp',
version : '1.1',
- meson_version : '>= 0.54',
+ meson_version : '>= 0.55',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized',
'c_std=c11',
- 'cpp_std=c++14',
+ 'cpp_std=c++17',
]
)
@@ -34,6 +34,17 @@ cpp = meson.get_compiler('cpp')
host_system = host_machine.system()
+# Don't rely on the cross file setting the system properly when targeting ios
+if host_system == 'darwin' and meson.is_cross_build()
+ ios_test_code = '''#include <TargetConditionals.h>
+ #if ! TARGET_OS_IPHONE
+ #error "Not iOS/tvOS/watchOS/iPhoneSimulator"
+ #endif'''
+ if cc.compiles(ios_test_code, name : 'building for iOS')
+ host_system = 'ios'
+ endif
+endif
+
platform_cflags = []
os_cflags = []
os_deps = []
@@ -41,89 +52,21 @@ have_posix = false
have_win = false
# Let's use pkg-config if available. This will also fallback to the subproject
-# if pkg-config is not found, instead of CMake or manual library detection.
-# This might be surprising, but is hopefully a temporary state until recent
-# abseil versions become the norm.
-absl_base_dep = dependency('absl_base', required : false,
- fallback: [ 'abseil-cpp', 'absl_base_dep' ]
-)
-absl_flags_dep = dependency('absl_flags_parse', required : false,
- fallback: [ 'abseil-cpp', 'absl_flags_dep' ]
-)
-absl_optional_dep = dependency('absl_optional', required : false,
- fallback: [ 'abseil-cpp', 'absl_types_dep' ]
-)
-absl_strings_dep = dependency('absl_strings', required : false,
- fallback: [ 'abseil-cpp', 'absl_strings_dep' ]
-)
-absl_synchronization_dep = dependency('absl_synchronization', required : false,
- fallback: [ 'abseil-cpp', 'absl_synchronization_dep' ]
-)
-
-# If we have the base dep, assume the rest should be present to
-if absl_base_dep.found()
- absl_dep = [
- absl_base_dep,
- absl_flags_dep,
- absl_optional_dep,
- absl_strings_dep,
- absl_synchronization_dep,
- ]
-else
- warning('Could not find abseil-cpp with pkg-config, trying CMake-based library detection.')
- absl_dep = dependency('absl', method : 'cmake',
- modules : [
- 'absl::base',
- 'absl::flags_parse',
- 'absl::optional',
- 'absl::strings',
- 'absl::synchronization',
- ],
- required : false,
- )
-
- if not absl_dep.found()
- warning('Could not find abseil-cpp with CMake, using fallback library detection which may fail.')
- absl_libs = [
- 'absl_base',
- 'absl_bad_optional_access',
- 'absl_city',
- 'absl_flags_commandlineflag',
- 'absl_flags_commandlineflag_internal',
- 'absl_flags_config',
- 'absl_flags_internal',
- 'absl_flags_marshalling',
- 'absl_flags_parse',
- 'absl_flags_private_handle_accessor',
- 'absl_flags_program_name',
- 'absl_flags_reflection',
- 'absl_flags_usage',
- 'absl_flags_usage_internal',
- 'absl_hash',
- 'absl_int128',
- 'absl_malloc_internal',
- 'absl_raw_logging_internal',
- 'absl_spinlock_wait',
- 'absl_stacktrace',
- 'absl_str_format_internal',
- 'absl_strings',
- 'absl_symbolize',
- 'absl_synchronization',
- 'absl_throw_delegate',
- 'absl_time',
- 'absl_time_zone',
- ]
- absl_dep = []
- foreach l : absl_libs
- absl_dep += cpp.find_library(l, required : false)
- endforeach
- endif
-endif
+# if pkg-config is not found, which is really the most reliable way of building
+# abseil due to strict C++ standard match requirements.
+absl_dep = [
+ dependency('absl_base', default_options: ['cpp_std=c++17']),
+ dependency('absl_flags'),
+ dependency('absl_strings'),
+ dependency('absl_synchronization'),
+]
if ['darwin', 'ios'].contains(host_system)
os_cflags = ['-DWEBRTC_MAC']
if host_system == 'ios'
os_cflags += ['-DWEBRTC_IOS']
+ # For absl_bad_optional_access
+ absl_dep += [dependency('absl_types')]
endif
have_posix = true
elif host_system == 'android'
@@ -140,6 +83,10 @@ elif host_system == 'windows'
platform_cflags += ['-DWEBRTC_WIN', '-D_WIN32', '-U__STRICT_ANSI__']
# this one is for MinGW to get format specifiers from inttypes.h in C++
platform_cflags += ['-D__STDC_FORMAT_MACROS=1']
+ # Avoid min/max from windows.h which breaks std::min/max
+ platform_cflags += ['-DNOMINMAX']
+ # Ensure M_PI etc are defined
+ platform_cflags += ['-D_USE_MATH_DEFINES']
os_deps += [cc.find_library('winmm')]
have_win = true
endif
=====================================
subprojects/abseil-cpp.wrap
=====================================
@@ -1,18 +1,22 @@
[wrap-file]
-directory = abseil-cpp-20210324.2
-source_url = https://github.com/abseil/abseil-cpp/archive/20210324.2.tar.gz
-source_filename = abseil-cpp-20210324.2.tar.gz
-source_hash = 59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f
-patch_filename = abseil-cpp_20210324.2-3_patch.zip
-patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20210324.2-3/get_patch
-patch_hash = 87827a6ed1fcee2c5f36d57ccdadefd536bac544892d7196b578ffb671a25c0a
+directory = abseil-cpp-20230125.1
+source_url = https://github.com/abseil/abseil-cpp/archive/20230125.1.tar.gz
+source_filename = abseil-cpp-20230125.1.tar.gz
+source_hash = 81311c17599b3712069ded20cca09a62ab0bf2a89dfa16993786c8782b7ed145
+patch_filename = abseil-cpp_20230125.1-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/abseil-cpp_20230125.1-1/get_patch
+patch_hash = a920ab28067e433d7ead2d564a4f511628f498f0723f7f94d19317877787ef39
+source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/abseil-cpp_20230125.1-1/abseil-cpp-20230125.1.tar.gz
+wrapdb_version = 20230125.1-1
[provide]
absl_base = absl_base_dep
absl_container = absl_container_dep
absl_debugging = absl_debugging_dep
+absl_log = absl_log_dep
absl_flags = absl_flags_dep
absl_hash = absl_hash_dep
+absl_crc = absl_crc_dep
absl_numeric = absl_numeric_dep
absl_random = absl_random_dep
absl_status = absl_status_dep
@@ -20,4 +24,3 @@ absl_strings = absl_strings_dep
absl_synchronization = absl_synchronization_dep
absl_time = absl_time_dep
absl_types = absl_types_dep
-
=====================================
webrtc/rtc_base/logging.cc
=====================================
@@ -15,6 +15,7 @@
#if RTC_LOG_ENABLED()
#if defined(WEBRTC_WIN)
+#include <winsock2.h>
#include <windows.h>
#if _MSC_VER < 1900
#define snprintf _snprintf
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/compare/ca1186946d3c9d08229c02cc7a46c3caf766ca2e...096b0eaed22f07282090146283e6c7f6d8d977d9
--
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/webrtc-audio-processing/-/compare/ca1186946d3c9d08229c02cc7a46c3caf766ca2e...096b0eaed22f07282090146283e6c7f6d8d977d9
You're receiving this email because of your account on gitlab.freedesktop.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20230525/169779eb/attachment-0001.htm>
More information about the pulseaudio-commits
mailing list