winlin

fix utest build failed for osx.

@@ -20,6 +20,15 @@ SRS_TRUNK_PREFIX=../.. @@ -20,6 +20,15 @@ SRS_TRUNK_PREFIX=../..
20 # gest dir, relative to objs/utest, it's trunk/objs/gtest 20 # gest dir, relative to objs/utest, it's trunk/objs/gtest
21 GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/gtest 21 GTEST_DIR=${SRS_TRUNK_PREFIX}/${SRS_OBJS_DIR}/gtest
22 22
  23 +# the extra defines to compile utest.
  24 +EXTRA_DEFINES=""
  25 +
  26 +# for osx to disable the error.
  27 +# gtest/include/gtest/internal/gtest-port.h:499:13: fatal error: 'tr1/tuple' file not found
  28 +if [ $SRS_OSX = YES ]; then
  29 + EXTRA_DEFINES="$EXTRA_DEFINES -DGTEST_HAS_TR1_TUPLE=0"
  30 +fi
  31 +
23 cat << END > ${FILE} 32 cat << END > ${FILE}
24 # user must run make the ${SRS_OBJS_DIR}/utest dir 33 # user must run make the ${SRS_OBJS_DIR}/utest dir
25 # at the same dir of Makefile. 34 # at the same dir of Makefile.
@@ -49,7 +58,7 @@ USER_DIR = . @@ -49,7 +58,7 @@ USER_DIR = .
49 CPPFLAGS += -I\$(GTEST_DIR)/include 58 CPPFLAGS += -I\$(GTEST_DIR)/include
50 59
51 # Flags passed to the C++ compiler. 60 # Flags passed to the C++ compiler.
52 -CXXFLAGS += -g -Wall -Wextra -O0 61 +CXXFLAGS += -g -Wall -Wextra -O0 ${EXTRA_DEFINES}
53 62
54 # All tests produced by this Makefile. Remember to add new tests you 63 # All tests produced by this Makefile. Remember to add new tests you
55 # created to the list. 64 # created to the list.