1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 11:21:52 +00:00

Support utest on mac osx

This commit is contained in:
winlin 2020-03-29 17:29:09 +08:00
parent 1c65987472
commit 80f315f1ae
5 changed files with 8 additions and 10 deletions

View file

@ -334,10 +334,10 @@ if [ $SRS_EXPORT_LIBRTMP_PROJECT = NO ]; then
ln -sf .src/$file $file;
done &&
# Link source files under .src/xxx, the first child dir.
for dir in `(cd .src && find . -type d|grep '\./'|grep -v Linux|grep -v Darwin)`; do
for dir in `(cd .src && find . -maxdepth 1 -type d|grep '\./'|grep -v Linux|grep -v Darwin)`; do
mkdir -p $dir &&
for file in `(cd .src/$dir && find . -maxdepth 1 -type f ! -name '*.o' ! -name '*.d')`; do
ln -sf .src/$dir/$file $dir/$file;
ln -sf ../.src/$dir/$file $dir/$file;
done;
done &&
# Build source code.

View file

@ -573,10 +573,6 @@ function check_option_conflicts() {
echo "Don't support building FFMPEG, please use docker https://github.com/ossrs/srs-docker"; exit -1;
fi
if [[ $SRS_OSX == YES && $SRS_UTEST == YES ]]; then
echo "Mac does not support utest."; exit -1;
fi
# TODO: FIXME: check more os.
__check_ok=YES

View file

@ -13,7 +13,7 @@ echo "SRS_WORKDIR: ${SRS_WORKDIR}, SRS_OBJS_DIR: ${SRS_OBJS_DIR}, SRS_OBJS: ${SR
# For src object files on each platform.
(
mkdir -p ${SRS_OBJS_DIR} && cd ${SRS_OBJS_DIR} &&
rm -rf src utest srs research include lib srs_hls_ingester srs_mp4_parser &&
rm -rf src utest srs srs_utest research include lib srs_hls_ingester srs_mp4_parser &&
mkdir -p ${SRS_PLATFORM}/src && ln -sf ${SRS_PLATFORM}/src &&
mkdir -p ${SRS_PLATFORM}/utest && ln -sf ${SRS_PLATFORM}/utest &&
mkdir -p ${SRS_PLATFORM}/research && ln -sf ${SRS_PLATFORM}/research &&

View file

@ -20,9 +20,6 @@ SRS_TRUNK_PREFIX=../../..
# gest dir, relative to objs/utest, it's trunk/objs/gtest
GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/gtest
# the extra defines to compile utest.
EXTRA_DEFINES=""
cat << END > ${FILE}
# user must run make the ${SRS_OBJS_DIR}/utest dir
# at the same dir of Makefile.

5
trunk/configure vendored
View file

@ -314,6 +314,11 @@ if [ $SRS_LIBRTMP = YES ]; then
MODULE_OBJS="${CORE_OBJS[@]} ${KERNEL_OBJS[@]} ${PROTOCOL_OBJS[@]} ${LIBS_OBJS[@]}"
BUILD_KEY="librtmp" LIB_NAME="lib/srs_librtmp" . auto/libs.sh
fi
# For utest on mac.
# @see https://github.com/protocolbuffers/protobuf/issues/51#issuecomment-111044468
if [[ $SRS_OSX == YES ]]; then
EXTRA_DEFINES="-DGTEST_USE_OWN_TR1_TUPLE=1"
fi
#
# utest, the unit-test cases of srs, base on gtest1.6
if [ $SRS_UTEST = YES ]; then