Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] - Reduce libsairedis build time by 16m #1413

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ AC_DEFINE([SAI_GIT_REVISION],
"[m4_esyscmd([echo -n $(cd SAI && git rev-parse --short HEAD || echo 0000000)])]",
[SAI git revision information])

AM_CONDITIONAL(CXX_IS_GCC, test x$CXX = xg++)

AC_OUTPUT(Makefile
meta/Makefile
lib/Makefile
Expand Down
20 changes: 18 additions & 2 deletions pyext/py2/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,27 @@ SOURCES=../pysairedis.h ../pysairedis.cpp
pkgpython_PYTHON = pysairedis.py __init__.py
pkgpyexec_LTLIBRARIES = _pysairedis.la

#
# -fno-var-tracking-assignments is set for the GCC compiler
# suite to improve build performance. pysairedis_wrap.cpp is
# automatically generated by SWIG, so it's not a big loss.
#
if CXX_IS_GCC
CXXFLAGS_COMPILER = "-fno-var-tracking-assignments"
else
CXXFLAGS_COMPILER = ""
endif

AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/lib -I..

BUILT_SOURCES = pysairedis_wrap.cpp

_pysairedis_la_SOURCES = pysairedis_wrap.cpp $(SOURCES)
libpysairedis_wrap_la_SOURCES = pysairedis_wrap.cpp
libpysairedis_wrap_la_CXXFLAGS = $(PYTHON2_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) \
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(CXXFLAGS_COMPILER) $(NO_CAST_FUNCTION_TYPE)

noinst_LTLIBRARIES = libpysairedis_wrap.la
_pysairedis_la_SOURCES = $(SOURCES)
_pysairedis_la_CXXFLAGS = $(PYTHON2_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) \
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(NO_CAST_FUNCTION_TYPE)

Expand All @@ -18,7 +34,7 @@ _pysairedis_la_LDFLAGS = -module \
-L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta \
-lzmq

_pysairedis_la_LIBADD = $(PYTHON2_LIBS)
_pysairedis_la_LIBADD = $(PYTHON2_LIBS) libpysairedis_wrap.la

SWIG_FLAG = -Wall -c++ -python -keyword
if ARCH64
Expand Down
21 changes: 19 additions & 2 deletions pyext/py3/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@ SOURCES=../pysairedis.h ../pysairedis.cpp
pkgpython3_PYTHON = pysairedis.py __init__.py
pkgpy3exec_LTLIBRARIES = _pysairedis.la

#
# -fno-var-tracking-assignments is set for the GCC compiler
# suite to improve build performance. pysairedis_wrap.cpp is
# automatically generated by SWIG, so it's not a big loss.
#
if CXX_IS_GCC
CXXFLAGS_COMPILER = "-fno-var-tracking-assignments"
else
CXXFLAGS_COMPILER = ""
endif

AM_CXXFLAGS = $(SAIINC) -I$(top_srcdir)/lib -I..

BUILT_SOURCES = pysairedis_wrap.cpp

_pysairedis_la_SOURCES = pysairedis_wrap.cpp $(SOURCES)

libpysairedis_wrap_la_SOURCES = pysairedis_wrap.cpp
libpysairedis_wrap_la_CXXFLAGS = $(PYTHON3_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) \
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(CXXFLAGS_COMPILER) $(NO_CAST_FUNCTION_TYPE)

noinst_LTLIBRARIES = libpysairedis_wrap.la
_pysairedis_la_SOURCES = $(SOURCES)
_pysairedis_la_CXXFLAGS = $(PYTHON3_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS_COMMON) \
-Wno-cast-qual -Wno-shadow -Wno-redundant-decls -Wno-conversion $(NO_CAST_FUNCTION_TYPE)

Expand All @@ -18,7 +35,7 @@ _pysairedis_la_LDFLAGS = -module \
-L$(top_srcdir)/meta/.libs -lsaimetadata -lsaimeta \
-lzmq

_pysairedis_la_LIBADD = $(PYTHON3_BLDLIBRARY)
_pysairedis_la_LIBADD = $(PYTHON3_BLDLIBRARY) libpysairedis_wrap.la

SWIG_FLAG = -Wall -c++ -python -keyword
if ARCH64
Expand Down
Loading