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

Externalize templates to speed up build #5

Open
wants to merge 2 commits into
base: introduce-cmake
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: 0 additions & 2 deletions .github/workflows/getdeps_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read # to fetch code (actions/checkout)
Expand Down
1 change: 1 addition & 0 deletions mcrouter/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ libmcroutercore_a_SOURCES = \
ProxyBase.h \
ProxyConfig-inl.h \
ProxyConfig.h \
ProxyConfig.cpp \
ProxyConfigBuilder.cpp \
ProxyConfigBuilder.h \
ProxyDestination.cpp \
Expand Down
3 changes: 3 additions & 0 deletions mcrouter/ProxyConfig-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "mcrouter/Proxy.h"
#include "mcrouter/lib/config/RouteHandleFactory.h"
#include "mcrouter/lib/fbi/cpp/util.h"
#include "mcrouter/lib/network/gen/MemcacheRouterInfo.h"
#include "mcrouter/routes/McRouteHandleProvider.h"
#include "mcrouter/routes/PrefixSelectorRoute.h"
#include "mcrouter/routes/ProxyRoute.h"
Expand All @@ -24,6 +25,8 @@ namespace facebook {
namespace memcache {
namespace mcrouter {

extern template class ProxyConfig<facebook::memcache::MemcacheRouterInfo>;

template <class RouterInfo>
ProxyConfig<RouterInfo>::ProxyConfig(
Proxy<RouterInfo>& proxy,
Expand Down
7 changes: 7 additions & 0 deletions mcrouter/ProxyConfig.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "mcrouter/ProxyConfig.h"
#include "mcrouter/ServiceInfo.h"
#include "mcrouter/lib/network/gen/MemcacheRouterInfo.h"

namespace facebook::memcache::mcrouter {
template class ProxyConfig<facebook::memcache::MemcacheRouterInfo>;
}
3 changes: 3 additions & 0 deletions mcrouter/ServiceInfo-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
namespace facebook {
namespace memcache {
namespace mcrouter {

extern template class ServiceInfo<facebook::memcache::MemcacheRouterInfo>;

namespace detail {

bool srHostInfoPtrFuncRouteHandlesCommandDispatcher(
Expand Down
13 changes: 7 additions & 6 deletions mcrouter/ServiceInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
#include "mcrouter/ServiceInfo.h"
#include "mcrouter/mcrouter_sr_deps.h"

namespace facebook::memcache::mcrouter::detail {
namespace facebook::memcache::mcrouter {

template class ServiceInfo<facebook::memcache::MemcacheRouterInfo>;

namespace detail {
bool srHostInfoPtrFuncRouteHandlesCommandDispatcher(
const HostInfoPtr& host,
std::string& tree,
const int level) {
const HostInfoPtr& host, std::string& tree, const int level) {
bool haveHost = (host != nullptr);
tree.append(
std::string(level, ' ') +
Expand All @@ -23,5 +24,5 @@ bool srHostInfoPtrFuncRouteHandlesCommandDispatcher(
'\n');
return false;
}

} // namespace facebook::memcache::mcrouter::detail
} // namespace detail
} // namespace facebook::memcache::mcrouter