Skip to content

Commit

Permalink
Fix OSS build (#445)
Browse files Browse the repository at this point in the history
Summary:
mcrouter currently does not compile, since the build system is out of sync with recent changes.

Due to the use of `std::span` introduced in
9a24a4e, the project now requires C++20 to build. Update the `-std` flag accordingly, since the existing C++17 requirement was also introduced without much fanfare in 3181213 following a similar change.

Also update Automake files to reflect some newly added project files, and link against `serverdbginfo` and `runtime` from fbthrift, since they are now required.

Pull Request resolved: #445

Reviewed By: djvaporize

Differential Revision: D59706014

Pulled By: stuclar

fbshipit-source-id: 096bad533a9028e9188d60b9aab2bd4b7e383255
  • Loading branch information
mszabo-wikia authored and facebook-github-bot committed Jul 25, 2024
1 parent 984106a commit 34eb62e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions mcrouter/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ libmcroutercore_a_SOURCES = \
routes/FailoverRoute-inl.h \
routes/FailoverRoute.h \
routes/FailoverWithExptimeRouteFactory.h \
routes/HashStopAllowListRoute.h \
routes/HashStopAllowListRoute.cpp \
routes/HostIdRouteFactory.h \
routes/KeyParseRoute.h \
routes/KeyParseRoute.cpp \
routes/KeySplitRoute-inl.h \
routes/KeySplitRoute.h \
routes/L1L2CacheRouteFactory.h \
Expand Down Expand Up @@ -254,6 +258,7 @@ mcrouter_LDADD = \
libmcroutercore.a \
lib/libmcrouter.a \
-lthriftcpp2 \
-lserverdbginfo \
-ltransport \
-lthriftanyrep \
-lthrifttype \
Expand All @@ -264,6 +269,7 @@ mcrouter_LDADD = \
-lthriftmetadata \
-lasync \
-lconcurrency \
-lruntime \
-lthrift-core \
-lfmt \
-lwangle \
Expand Down
2 changes: 1 addition & 1 deletion mcrouter/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ AX_PYTHON_DEVEL()
AX_CXX_COMPILE_STDCXX_14([],[mandatory])
LT_INIT

CXXFLAGS="-fno-strict-aliasing -std=c++17 $CXXFLAGS"
CXXFLAGS="-fno-strict-aliasing -std=c++20 $CXXFLAGS"
CXXFLAGS="-W -Wall -Wextra -Wno-unused-parameter $CXXFLAGS"
CXXFLAGS=" -Wno-missing-field-initializers -Wno-deprecated $CXXFLAGS"
CXXFLAGS="-DLIBMC_FBTRACE_DISABLE -DDISABLE_COMPRESSION $CXXFLAGS"
Expand Down
4 changes: 3 additions & 1 deletion mcrouter/lib/network/test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ mock_mc_server_CPPFLAGS = -I$(top_srcdir)/..
mock_mc_server_LDADD = \
$(top_builddir)/lib/libmcrouter.a \
-lthriftcpp2 \
-lserverdbginfo \
-ltransport \
-lthriftanyrep \
-lthriftanyrep \
-lthrifttype \
-lthrifttyperep \
-lthriftprotocol \
-lrpcmetadata \
-lthriftmetadata \
-lasync \
-lconcurrency \
-lruntime \
-lthrift-core \
-lfmt \
-lfizz \
Expand Down

0 comments on commit 34eb62e

Please sign in to comment.