eden: add C datapack/treemanifest to cmake build

Summary:
This requires our mercurial repo to be available during
the build; I symlink it in alongside `common` in the `oss` dir,
and point it up to `scm/hg`.

This has partial support for mononoke too, but will need to add
logic to getdeps to pull down the proxygen repo and build that.

Reviewed By: simpkins

Differential Revision: D13480146

fbshipit-source-id: 54874245015af83a259f56944d2e5f87615baee7
This commit is contained in:
Wez Furlong 2019-01-17 18:46:04 -08:00 committed by Facebook Github Bot
parent 4e596a944b
commit a545acbbd4
7 changed files with 81 additions and 5 deletions

View File

@ -11,6 +11,7 @@ find_package(wangle CONFIG REQUIRED)
find_package(FBThrift CONFIG REQUIRED)
find_package(Yarpl MODULE REQUIRED)
find_package(GMock MODULE REQUIRED)
find_package(OpenSSL MODULE REQUIRED)
find_package(SELinux)
set(EDEN_HAVE_SELINUX ${SELINUX_FOUND})
@ -33,6 +34,7 @@ find_package(cpptoml REQUIRED)
# We currently do not have treemanifest support in the opensource build
set(EDEN_HAVE_HG_TREEMANIFEST OFF)
set(EDEN_WIN_NO_RUST_DATAPACK ON)
set(EDEN_WIN_NOMONONOKE ON)
# TODO(strager): Support systemd in the opensource build.
set(EDEN_HAVE_SYSTEMD OFF)

View File

@ -0,0 +1,47 @@
# TODO: once we've gotten the rust datapack code integrated and
# building, update getdeps.py to optionally pull from the fb-mercurial
# repo on github and adjust this logic to use either the code from
# the local fbsource repo when building at FB, or from the
# external dir when building the OSS build.
if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/fb-mercurial)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/fb-mercurial)
add_library(
libmpatch
STATIC
fb-mercurial/mercurial/mpatch.c
)
add_library(
buffer
STATIC
fb-mercurial/lib/clib/buffer.c
)
add_library(
datapack
STATIC
fb-mercurial/hgext/extlib/cstore/datapackstore.cpp
fb-mercurial/hgext/extlib/cstore/deltachain.cpp
fb-mercurial/hgext/extlib/cstore/uniondatapackstore.cpp
fb-mercurial/hgext/extlib/ctreemanifest/manifest.cpp
fb-mercurial/hgext/extlib/ctreemanifest/manifest_entry.cpp
fb-mercurial/hgext/extlib/ctreemanifest/manifest_fetcher.cpp
fb-mercurial/hgext/extlib/ctreemanifest/manifest_ptr.cpp
fb-mercurial/hgext/extlib/ctreemanifest/treemanifest.cpp
fb-mercurial/lib/cdatapack/cdatapack.c
)
target_link_libraries(
datapack
PUBLIC
libmpatch
buffer
${OPENSSL_LIBRARIES}
)
target_include_directories(
datapack
PUBLIC
${OPENSSL_INCLUDE_DIR}
)
set(EDEN_HAVE_HG_TREEMANIFEST ON)
endif()

View File

@ -12,7 +12,7 @@
#define EDEN_VERSION "${PACKAGE_VERSION}"
#cmakedefine EDEN_HAVE_HG_TREEMANIFEST
#cmakedefine01 EDEN_HAVE_HG_TREEMANIFEST
#cmakedefine EDEN_HAVE_ROCKSDB
#cmakedefine EDEN_HAVE_SELINUX
#cmakedefine EDEN_HAVE_SQLITE3

View File

@ -30,13 +30,15 @@ set(CMAKE_CXX_STANDARD 17)
include(CompilerSettingsUnix)
include(EdenConfigChecks)
include(ThriftCppLibrary)
include(FBMercurialFeatures)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(common)
add_subdirectory(eden/fs)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/CMake/eden-config.h.in
${CMAKE_CURRENT_BINARY_DIR}/eden/fs/eden-config.h
)
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(common)
add_subdirectory(eden/fs)

View File

@ -15,3 +15,6 @@ target_link_libraries(
add_subdirectory(hg)
add_subdirectory(git)
if (NOT EDEN_WIN_NOMONONOKE)
add_subdirectory(mononoke)
endif()

View File

@ -4,12 +4,21 @@ add_library(
eden_store_hg STATIC
${STORE_HG_SRCS}
)
if (NOT EDEN_WIN_NOMONONOKE)
list(APPEND EDEN_STORE_HG_OPTIONAL_DEPS eden_store_mononoke)
endif()
if (EDEN_HAVE_HG_TREEMANIFEST)
list(APPEND EDEN_STORE_HG_OPTIONAL_DEPS datapack)
endif()
target_link_libraries(
eden_store_hg
PUBLIC
eden_model
eden_store
eden_utils
${EDEN_STORE_HG_OPTIONAL_DEPS}
)
add_executable(

View File

@ -0,0 +1,13 @@
# FIXME: need to pull in proxygen for this
file(GLOB STORE_MONONOKE_SRCS "*.cpp")
add_library(
eden_store_mononoke STATIC
${STORE_MONONOKE_SRCS}
)
target_link_libraries(
eden_store_mononoke
PUBLIC
eden_model
eden_store
eden_utils
)