Skip to content

Commit

Permalink
Set environment variable for OpenSSL in CMake file (facebookincubator…
Browse files Browse the repository at this point in the history
…#5309)

Summary:
Folly needs OpenSSL 1.1 version to function. In the presence of other
OpenSSL versions, it is possible that folly in bundled mode can pick up
other incompatible versions causing the build to fail.

Currently, in the `setup-macos.sh` script, we set
OPENSSL_ROOT_DIR=$(brew --prefix [email protected]).

We require a similar change for the bundled folly installs as well.
To achieve this goal, we now set the `OPENSSL_ROOT_DIR` environment
variable via the CMake file to set the path to the correct version of
OpenSSL.

Resolves facebookincubator#1446, facebookincubator#5309
  • Loading branch information
rishitc authored and majetideepak committed Jun 27, 2023
1 parent 16534bf commit 4b9127d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CMake/resolve_dependency_modules/folly/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ resolve_dependency_url(FOLLY)

message(STATUS "Building Folly from source")

# Required so cmake can use the correct version of the OpenSSL dependency for
# MacOS
if(APPLE)
execute_process(
COMMAND brew --prefix [email protected]
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(ENV{OPENSSL_ROOT_DIR} ${OPENSSL_ROOT_DIR})
endif()

if(gflags_SOURCE STREQUAL "BUNDLED")
set(glog_patch && git apply ${CMAKE_CURRENT_LIST_DIR}/folly-gflags-glog.patch)
endif()
Expand Down

0 comments on commit 4b9127d

Please sign in to comment.