sapling/eden/fs/store/mononoke/CMakeLists.txt
Zeyi (Rice) Fan 7f8aae31f9 getdeps: add libcurl and make Eden use libcurl instead of system curl
Summary:
We are seeing random segment fault originating from OpenSSL on macOS when
Mononoke fetching is enabled.

The cause is that on macOS we are actually linking against libcurl shipped with
the system instead of ours. That copy of libcurl is linked with macOS's
libcrypto instead of the one we compiles during Eden's build, and it seems that
version of libcrypto does not provide concurrency safety.

The solution is to build curl on macOS and make sure it is linked to our
OpenSSL that has the concurrency callbacks registered.

Reviewed By: wez

Differential Revision: D17657822

fbshipit-source-id: 85abdf3be10b3903a5efc6b3a91624c7258de790
2019-10-04 11:00:45 -07:00

47 lines
943 B
CMake

# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# FIXME: need to pull in proxygen for this
file(GLOB STORE_MONONOKE_SRCS "*.cpp")
if (NOT EDEN_HAVE_MONONOKE)
list(
REMOVE_ITEM
STORE_MONONOKE_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/MononokeHttpBackingStore.cpp
${CMAKE_CURRENT_SOURCE_DIR}/MononokeThriftBackingStore.cpp
)
endif()
if (NOT EDEN_HAVE_CURL)
list(
REMOVE_ITEM
STORE_MONONOKE_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/CurlHttpClient.cpp
${CMAKE_CURRENT_SOURCE_DIR}/MononokeCurlBackingStore.cpp
)
endif()
add_library(
eden_store_mononoke STATIC
${STORE_MONONOKE_SRCS}
)
target_link_libraries(
eden_store_mononoke
PUBLIC
eden_model
eden_store
eden_utils
)
if (CURL_FOUND)
target_link_libraries(
eden_store_mononoke
PUBLIC
CURL::libcurl
)
endif()