update the CMake based build with new dependencies

Summary:
Our CMake-based build had gotten somewhat out of date.  This fixes several
issues that were preventing it from building:
- wangle now depends on fizz, which in turn depends on libsodium
- fbthrift now depends on yarpl for the streaming functionality
- Eden now depends on libsqlite3
- The eden/fs/inode library now depends on eden/fs/config

Reviewed By: strager

Differential Revision: D10436531

fbshipit-source-id: f41065da2edb909e8eb94e03d0e62ae19ad3a84f
This commit is contained in:
Adam Simpkins 2018-10-23 13:39:58 -07:00 committed by Facebook Github Bot
parent d08f63df8f
commit 1b4ecb3ed4
5 changed files with 44 additions and 3 deletions

View File

@ -1,8 +1,14 @@
include(FindPkgConfig)
set(CMAKE_THREAD_PREFER_PTHREAD ON)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(folly CONFIG REQUIRED)
find_package(fizz CONFIG REQUIRED)
find_package(wangle CONFIG REQUIRED)
find_package(FBThrift CONFIG REQUIRED)
find_package(Yarpl MODULE REQUIRED)
find_package(GMock MODULE REQUIRED)
find_package(SELinux)

14
CMake/FindYarpl.cmake Normal file
View File

@ -0,0 +1,14 @@
#
# - Try to find the Facebook YARPL library
# This will define
# Yarpl_FOUND
# YARPL_INCLUDE_DIR
# YARPL_LIBRARIES
#
find_path(YARPL_INCLUDE_DIRS yarpl/Flowable.h)
find_library(YARPL_LIBRARIES yarpl)
mark_as_advanced(YARPL_INCLUDE_DIRS YARPL_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Yarpl YARPL_INCLUDE_DIRS YARPL_LIBRARIES)

View File

@ -15,5 +15,6 @@ target_link_libraries(
eden_fuse
eden_journal
eden_store
eden_config
eden_utils
)

View File

@ -34,5 +34,6 @@ target_link_libraries(
eden_store_hg
eden_store_git
eden_takeover
${YARPL_LIBRARIES}
Folly::folly
)

View File

@ -145,7 +145,7 @@ class MakeBuilder(BuilderBase):
class AutoconfBuilder(BuilderBase):
def __init__(self, subdir=None, env=None, args=None):
super(BuilderBase, self).__init__(subdir=subdir, env=env)
super(AutoconfBuilder, self).__init__(subdir=subdir, env=env)
self.args = args or []
def _build(self, project):
@ -154,7 +154,7 @@ class AutoconfBuilder(BuilderBase):
self._run_cmd(["autoreconf", "--install"])
configure_cmd = [
configure_path,
"--prefix=" + project.ops.install_dir,
"--prefix=" + project.opts.install_dir,
] + self.args
self._run_cmd(configure_cmd)
self._run_cmd(["make", "-j%s" % project.opts.num_jobs])
@ -229,12 +229,30 @@ def get_projects(opts):
GitUpdater("https://github.com/facebook/folly.git"),
CMakeBuilder(),
),
Project(
"libsodium",
opts,
GitUpdater("https://github.com/jedisct1/libsodium.git"),
AutoconfBuilder(),
),
Project(
"fizz",
opts,
GitUpdater("https://github.com/facebookincubator/fizz.git"),
CMakeBuilder(subdir="fizz"),
),
Project(
"wangle",
opts,
GitUpdater("https://github.com/facebook/wangle.git"),
CMakeBuilder(subdir="wangle"),
),
Project(
"rsocket-cpp",
opts,
GitUpdater("https://github.com/rsocket/rsocket-cpp.git"),
CMakeBuilder(subdir="yarpl"),
),
Project(
"fbthrift",
opts,
@ -291,6 +309,7 @@ def install_platform_deps():
"libevent-dev flex bison libgoogle-glog-dev libkrb5-dev "
"libsnappy-dev libsasl2-dev libnuma-dev libcurl4-gnutls-dev "
"libpcap-dev libdb5.3-dev cmake libfuse-dev libgit2-dev mercurial "
"libsqlite3-dev "
).split()
install_apt(ubuntu_pkgs)
else:
@ -313,7 +332,7 @@ def main():
"--update",
action="store_true",
default=False,
help="Updates the external projects repositories before " "building them",
help="Updates the external projects repositories before building them",
)
ap.add_argument(
"-C",