Unverified 提交 779af189 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Fix build on musl based systems (such as Alpine Linux) (#1279)

上级 2966c524
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* worker: Do not use references for async callbacks ([PR #1274](https://github.com/versatica/mediasoup/pull/1274)). * worker: Do not use references for async callbacks ([PR #1274](https://github.com/versatica/mediasoup/pull/1274)).
* liburing: Enable zero copy ([PR #1273](https://github.com/versatica/mediasoup/pull/1273)). * liburing: Enable zero copy ([PR #1273](https://github.com/versatica/mediasoup/pull/1273)).
* Fix build on musl based systems (such as Alpine Linux) ([PR #1279](https://github.com/versatica/mediasoup/pull/1279)).
### 3.13.12 ### 3.13.12
......
...@@ -44,6 +44,18 @@ if get_option('ms_rtc_logger_rtp') ...@@ -44,6 +44,18 @@ if get_option('ms_rtc_logger_rtp')
] ]
endif endif
cpp = meson.get_compiler('cpp')
# This is a workaround to define FLATBUFFERS_LOCALE_INDEPENDENT=0 outside
# flatbuffers project, which is needed in case the current arch doesn't support
# strtoll_l or strtoull_l (such as musl in Alpine Linux). Problem is that
# flatbuffers build system not only defines it for its own usage but also relies
# on it in its include/flatbuffers/util.h file, and if such a file is included
# by mediasoup source files (and it is included) build fails with "error:
# 'strtoull_l' was not declared in this scope".
# See issue: https://github.com/versatica/mediasoup/issues/1223
add_project_arguments('-DFLATBUFFERS_LOCALE_INDEPENDENT=@0@'.format(cpp.has_function('strtoull_l')), language: 'cpp')
common_sources = [ common_sources = [
'src/lib.cpp', 'src/lib.cpp',
'src/DepLibSRTP.cpp', 'src/DepLibSRTP.cpp',
...@@ -163,14 +175,13 @@ common_sources = [ ...@@ -163,14 +175,13 @@ common_sources = [
'src/RTC/RTCP/XrReceiverReferenceTime.cpp', 'src/RTC/RTCP/XrReceiverReferenceTime.cpp',
] ]
cpp = meson.get_compiler('cpp')
openssl_proj = subproject( openssl_proj = subproject(
'openssl', 'openssl',
default_options: [ default_options: [
'warning_level=0', 'warning_level=0',
], ],
) )
libuv_proj = subproject( libuv_proj = subproject(
'libuv', 'libuv',
default_options: [ default_options: [
...@@ -179,6 +190,7 @@ libuv_proj = subproject( ...@@ -179,6 +190,7 @@ libuv_proj = subproject(
'build_benchmarks=false', 'build_benchmarks=false',
], ],
) )
libsrtp2_proj = subproject( libsrtp2_proj = subproject(
'libsrtp2', 'libsrtp2',
default_options: [ default_options: [
...@@ -188,6 +200,7 @@ libsrtp2_proj = subproject( ...@@ -188,6 +200,7 @@ libsrtp2_proj = subproject(
'tests=disabled', 'tests=disabled',
], ],
) )
usrsctp_proj = subproject( usrsctp_proj = subproject(
'usrsctp', 'usrsctp',
default_options: [ default_options: [
...@@ -195,6 +208,7 @@ usrsctp_proj = subproject( ...@@ -195,6 +208,7 @@ usrsctp_proj = subproject(
'sctp_build_programs=false', 'sctp_build_programs=false',
], ],
) )
abseil_cpp_proj = subproject( abseil_cpp_proj = subproject(
'abseil-cpp', 'abseil-cpp',
default_options: [ default_options: [
...@@ -202,20 +216,24 @@ abseil_cpp_proj = subproject( ...@@ -202,20 +216,24 @@ abseil_cpp_proj = subproject(
'cpp_std=c++17', 'cpp_std=c++17',
], ],
) )
catch2_proj = subproject( catch2_proj = subproject(
'catch2', 'catch2',
default_options: [ default_options: [
'warning_level=0', 'warning_level=0',
], ],
) )
flatbuffers_proj = subproject( flatbuffers_proj = subproject(
'flatbuffers', 'flatbuffers',
default_options: [ default_options: [
'warning_level=0', 'warning_level=0',
], ],
) )
# flatbuffers schemas subdirectory. # flatbuffers schemas subdirectory.
subdir('fbs') subdir('fbs')
# Add current build directory so libwebrtc has access to FBS folder. # Add current build directory so libwebrtc has access to FBS folder.
libwebrtc_include_directories = include_directories('include', 'fbs') libwebrtc_include_directories = include_directories('include', 'fbs')
subdir('deps/libwebrtc') subdir('deps/libwebrtc')
...@@ -305,48 +323,48 @@ executable( ...@@ -305,48 +323,48 @@ executable(
) )
test_sources = [ test_sources = [
'test/src/tests.cpp', 'test/src/tests.cpp',
'test/src/RTC/TestKeyFrameRequestManager.cpp', 'test/src/RTC/TestKeyFrameRequestManager.cpp',
'test/src/RTC/TestNackGenerator.cpp', 'test/src/RTC/TestNackGenerator.cpp',
'test/src/RTC/TestRateCalculator.cpp', 'test/src/RTC/TestRateCalculator.cpp',
'test/src/RTC/TestRtpPacket.cpp', 'test/src/RTC/TestRtpPacket.cpp',
'test/src/RTC/TestRtpPacketH264Svc.cpp', 'test/src/RTC/TestRtpPacketH264Svc.cpp',
'test/src/RTC/TestRtpRetransmissionBuffer.cpp', 'test/src/RTC/TestRtpRetransmissionBuffer.cpp',
'test/src/RTC/TestRtpStreamSend.cpp', 'test/src/RTC/TestRtpStreamSend.cpp',
'test/src/RTC/TestRtpStreamRecv.cpp', 'test/src/RTC/TestRtpStreamRecv.cpp',
'test/src/RTC/TestSeqManager.cpp', 'test/src/RTC/TestSeqManager.cpp',
'test/src/RTC/TestTrendCalculator.cpp', 'test/src/RTC/TestTrendCalculator.cpp',
'test/src/RTC/TestRtpEncodingParameters.cpp', 'test/src/RTC/TestRtpEncodingParameters.cpp',
'test/src/RTC/Codecs/TestVP8.cpp', 'test/src/RTC/Codecs/TestVP8.cpp',
'test/src/RTC/Codecs/TestVP9.cpp', 'test/src/RTC/Codecs/TestVP9.cpp',
'test/src/RTC/Codecs/TestH264.cpp', 'test/src/RTC/Codecs/TestH264.cpp',
'test/src/RTC/Codecs/TestH264_SVC.cpp', 'test/src/RTC/Codecs/TestH264_SVC.cpp',
'test/src/RTC/RTCP/TestFeedbackPsAfb.cpp', 'test/src/RTC/RTCP/TestFeedbackPsAfb.cpp',
'test/src/RTC/RTCP/TestFeedbackPsFir.cpp', 'test/src/RTC/RTCP/TestFeedbackPsFir.cpp',
'test/src/RTC/RTCP/TestFeedbackPsLei.cpp', 'test/src/RTC/RTCP/TestFeedbackPsLei.cpp',
'test/src/RTC/RTCP/TestFeedbackPsPli.cpp', 'test/src/RTC/RTCP/TestFeedbackPsPli.cpp',
'test/src/RTC/RTCP/TestFeedbackPsRemb.cpp', 'test/src/RTC/RTCP/TestFeedbackPsRemb.cpp',
'test/src/RTC/RTCP/TestFeedbackPsRpsi.cpp', 'test/src/RTC/RTCP/TestFeedbackPsRpsi.cpp',
'test/src/RTC/RTCP/TestFeedbackPsSli.cpp', 'test/src/RTC/RTCP/TestFeedbackPsSli.cpp',
'test/src/RTC/RTCP/TestFeedbackPsTst.cpp', 'test/src/RTC/RTCP/TestFeedbackPsTst.cpp',
'test/src/RTC/RTCP/TestFeedbackPsVbcm.cpp', 'test/src/RTC/RTCP/TestFeedbackPsVbcm.cpp',
'test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp', 'test/src/RTC/RTCP/TestFeedbackRtpEcn.cpp',
'test/src/RTC/RTCP/TestFeedbackRtpNack.cpp', 'test/src/RTC/RTCP/TestFeedbackRtpNack.cpp',
'test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp', 'test/src/RTC/RTCP/TestFeedbackRtpSrReq.cpp',
'test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp', 'test/src/RTC/RTCP/TestFeedbackRtpTllei.cpp',
'test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp', 'test/src/RTC/RTCP/TestFeedbackRtpTmmb.cpp',
'test/src/RTC/RTCP/TestFeedbackRtpTransport.cpp', 'test/src/RTC/RTCP/TestFeedbackRtpTransport.cpp',
'test/src/RTC/RTCP/TestBye.cpp', 'test/src/RTC/RTCP/TestBye.cpp',
'test/src/RTC/RTCP/TestReceiverReport.cpp', 'test/src/RTC/RTCP/TestReceiverReport.cpp',
'test/src/RTC/RTCP/TestSdes.cpp', 'test/src/RTC/RTCP/TestSdes.cpp',
'test/src/RTC/RTCP/TestSenderReport.cpp', 'test/src/RTC/RTCP/TestSenderReport.cpp',
'test/src/RTC/RTCP/TestPacket.cpp', 'test/src/RTC/RTCP/TestPacket.cpp',
'test/src/RTC/RTCP/TestXr.cpp', 'test/src/RTC/RTCP/TestXr.cpp',
'test/src/Utils/TestBits.cpp', 'test/src/Utils/TestBits.cpp',
'test/src/Utils/TestByte.cpp', 'test/src/Utils/TestByte.cpp',
'test/src/Utils/TestIP.cpp', 'test/src/Utils/TestIP.cpp',
'test/src/Utils/TestString.cpp', 'test/src/Utils/TestString.cpp',
'test/src/Utils/TestTime.cpp', 'test/src/Utils/TestTime.cpp',
] ]
mediasoup_worker_test = executable( mediasoup_worker_test = executable(
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论