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 committed Jun 20, 2023
1 parent 92323c6 commit 52dc2aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,14 @@ set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

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

execute_process(
COMMAND
bash -c
Expand Down

0 comments on commit 52dc2aa

Please sign in to comment.