sapling/eden/scm/lib/backingstore/CMakeLists.txt
Xavier Deguillard 632bd53a02 revisionstore: add a LFS remote store
Summary:
This enables fetching blobs from the LFS server. For now, this is limited to
fetching them, but the protocol specify ways to also upload. That second part
will matter for commit cloud and when pushing code to the server.

One caveat to this code is that the LFS server is not mocked in tests, and thus
requests are done directly to the server. I chose very small blobs to limit the
disruption to the server, by setting a test specific user-agent, we should be
able to monitor traffic due to tests and potentially rate limit it.

Reviewed By: DurhamG

Differential Revision: D20445628

fbshipit-source-id: beb3acb3f69dd27b54f8df7ccb95b04192deca30
2020-03-19 14:36:18 -07:00

55 lines
1.2 KiB
CMake

rust_static_library(rust_backingstore CRATE backingstore)
install_rust_static_library(
rust_backingstore
EXPORT mercurial
INSTALL_DIR lib
)
file(GLOB C_API_SRCS "c_api/*.cpp")
add_library(backingstore "${C_API_SRCS}")
set_target_properties(
backingstore
PROPERTIES
PUBLIC_HEADER
"c_api/HgNativeBackingStore.h;c_api/RustBackingStore.h"
)
target_include_directories(backingstore PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(
backingstore
PRIVATE
rust_backingstore
Folly::folly
)
# curl used in the Rust crate has its own copy of curl compiled and it uses
# Crypt32 and Secur32 on Windows. We need to declare the link dependencies here
# to avoid linker errors.
if (WIN32)
target_link_libraries(
backingstore
PRIVATE
Crypt32
Secur32
Ncrypt
)
endif()
# Reqwest links against the security framework.
if (APPLE)
target_link_libraries(
backingstore
PRIVATE
"-framework Security"
)
endif()
install(
TARGETS backingstore
EXPORT mercurial
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
PUBLIC_HEADER DESTINATION "include/eden/scm/lib/backingstore/c_api"
)