File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,17 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
135135 [ AC_MSG_RESULT ( [ no] ) ] )
136136CXXFLAGS="$SAVED_FLAGS"
137137
138+ AC_SUBST ( NO_CAST_FUNCTION_TYPE )
139+
140+ SAVED_FLAGS="$CXXFLAGS"
141+ CXXFLAGS="-Wno-cast-function-type"
142+ AC_MSG_CHECKING ( [ whether CXX supports -Wno-cast-function-type] )
143+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ ] ) ] ,
144+ [ AC_MSG_RESULT ( [ yes] ) ]
145+ [ AC_SUBST ( [ NO_CAST_FUNCTION_TYPE] , [ "-Wno-cast-function-type"] ) ] ,
146+ [ AC_MSG_RESULT ( [ no] ) ] )
147+ CXXFLAGS="$SAVED_FLAGS"
148+
138149AC_SUBST ( CFLAGS_COMMON )
139150
140151AC_OUTPUT (Makefile
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ INCLUDE=-I../../SAI/inc -I../../SAI/meta -I../../SAI/experimental -I../../lib/in
88
99_pysairedis_la_SOURCES = pysairedis_wrap.cpp $(SOURCES )
1010_pysairedis_la_CPPFLAGS = $(INCLUDE ) -I/usr/include/python$(PYTHON_VERSION ) $(AM_CPPFLAGS ) $(CFLAGS_COMMON ) \
11- -Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-cast-function-type
11+ -Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(NO_CAST_FUNCTION_TYPE )
12+
1213_pysairedis_la_LDFLAGS = -module \
1314 -lhiredis -lswsscommon -lpthread \
1415 -L$(top_srcdir ) /lib/src/.libs -lsairedis \
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ INCLUDE=-I../../SAI/inc -I../../SAI/meta -I../../SAI/experimental -I../../lib/in
88
99_pysairedis_la_SOURCES = pysairedis_wrap.cpp $(SOURCES )
1010_pysairedis_la_CPPFLAGS = $(INCLUDE ) -I/usr/include/python$(PYTHON3_VERSION ) $(AM_CPPFLAGS ) $(CFLAGS_COMMON ) \
11- -Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-cast-function-type
11+ -Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(NO_CAST_FUNCTION_TYPE )
12+
1213_pysairedis_la_LDFLAGS = -module \
1314 -lhiredis -lswsscommon -lpthread \
1415 -L$(top_srcdir ) /lib/src/.libs -lsairedis \
You can’t perform that action at this time.
0 commit comments