1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

add c++14 support

This commit is contained in:
莫战 2020-06-11 17:12:37 +08:00 committed by winlin
parent 31ff84c82d
commit db8d91cbee
3 changed files with 18 additions and 0 deletions

View file

@ -75,6 +75,12 @@ else
srs_undefine_macro "SRS_CXX11" $SRS_AUTO_HEADERS_H srs_undefine_macro "SRS_CXX11" $SRS_AUTO_HEADERS_H
fi fi
if [ $SRS_CXX14 = YES ]; then
srs_define_macro "SRS_CXX14" $SRS_AUTO_HEADERS_H
else
srs_undefine_macro "SRS_CXX14" $SRS_AUTO_HEADERS_H
fi
if [ $SRS_RTC = YES ]; then if [ $SRS_RTC = YES ]; then
srs_define_macro "SRS_RTC" $SRS_AUTO_HEADERS_H srs_define_macro "SRS_RTC" $SRS_AUTO_HEADERS_H
else else

View file

@ -20,6 +20,7 @@ SRS_SRT=NO
SRS_RTC=YES SRS_RTC=YES
SRS_GB28181=NO SRS_GB28181=NO
SRS_CXX11=NO SRS_CXX11=NO
SRS_CXX14=NO
SRS_NGINX=NO SRS_NGINX=NO
SRS_FFMPEG_TOOL=NO SRS_FFMPEG_TOOL=NO
SRS_LIBRTMP=NO SRS_LIBRTMP=NO
@ -151,6 +152,7 @@ Features:
--rtc=on|off Whether build the WebRTC support for SRS. --rtc=on|off Whether build the WebRTC support for SRS.
--gb28181=on|off Whether build the GB28181 support for SRS. --gb28181=on|off Whether build the GB28181 support for SRS.
--cxx11=on|off Whether enable the C++11 support for SRS. --cxx11=on|off Whether enable the C++11 support for SRS.
--cxx14=on|off Whether enable the C++14 support for SRS.
--prefix=<path> The absolute installation path for srs. Default: $SRS_PREFIX --prefix=<path> The absolute installation path for srs. Default: $SRS_PREFIX
--gcov=on|off Whether enable the GCOV compiler options. --gcov=on|off Whether enable the GCOV compiler options.
@ -324,6 +326,7 @@ function parse_user_option() {
--gb28181) if [[ $value == off ]]; then SRS_GB28181=NO; else SRS_GB28181=YES; fi ;; --gb28181) if [[ $value == off ]]; then SRS_GB28181=NO; else SRS_GB28181=YES; fi ;;
--cxx11) if [[ $value == off ]]; then SRS_CXX11=NO; else SRS_CXX11=YES; fi ;; --cxx11) if [[ $value == off ]]; then SRS_CXX11=NO; else SRS_CXX11=YES; fi ;;
--cxx14) if [[ $value == off ]]; then SRS_CXX14=NO; else SRS_CXX14=YES; fi ;;
--with-clean) SRS_CLEAN=YES ;; --with-clean) SRS_CLEAN=YES ;;
--without-clean) SRS_CLEAN=NO ;; --without-clean) SRS_CLEAN=NO ;;
@ -523,6 +526,11 @@ function apply_user_presets() {
if [[ $SRS_SRT == YES ]]; then if [[ $SRS_SRT == YES ]]; then
SRS_CXX11=YES SRS_CXX11=YES
fi fi
# Enable c++14 for RTC
if [[ $SRS_RTC == YES ]]; then
SRS_CXX14=YES
fi
} }
apply_user_presets apply_user_presets
@ -623,6 +631,7 @@ function regenerate_options() {
if [ $SRS_SIMULATOR = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --simulator=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --simulator=off"; fi if [ $SRS_SIMULATOR = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --simulator=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --simulator=off"; fi
if [ $SRS_GB28181 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gb28181=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gb28181=off"; fi if [ $SRS_GB28181 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gb28181=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --gb28181=off"; fi
if [ $SRS_CXX11 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx11=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx11=off"; fi if [ $SRS_CXX11 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx11=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx11=off"; fi
if [ $SRS_CXX14 = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx14=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --cxx14=off"; fi
if [ $SRS_NASM = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --nasm=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --nasm=off"; fi if [ $SRS_NASM = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --nasm=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --nasm=off"; fi
if [ $SRS_SRTP_ASM = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --srtp-nasm=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --srtp-nasm=off"; fi if [ $SRS_SRTP_ASM = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --srtp-nasm=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --srtp-nasm=off"; fi
if [ $SRS_SENDMMSG = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sendmmsg=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sendmmsg=off"; fi if [ $SRS_SENDMMSG = YES ]; then SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sendmmsg=on"; else SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --sendmmsg=off"; fi

3
trunk/configure vendored
View file

@ -90,6 +90,9 @@ CppStd="-ansi"
if [[ $SRS_CXX11 == YES ]]; then if [[ $SRS_CXX11 == YES ]]; then
CppStd="-std=c++11" CppStd="-std=c++11"
fi fi
if [[ $SRS_CXX14 == YES ]]; then
CppStd="-std=c++14"
fi
# performance of gprof # performance of gprof
SrsGprof=""; SrsGprofLink=""; if [ $SRS_GPROF = YES ]; then SrsGprof=" -pg -lc_p"; SrsGprofLink=" -pg"; fi SrsGprof=""; SrsGprofLink=""; if [ $SRS_GPROF = YES ]; then SrsGprof=" -pg -lc_p"; SrsGprofLink=" -pg"; fi
# performance of gperf # performance of gperf