Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] pick sane defaults for OPENSSL_ROOT_DIR on ARM macOS #504

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ set(ENABLE_MULTIVERSION_PROTOCOL_TEST FALSE CACHE BOOL "Enable nodeos multiversi

# add defaults for openssl
if(APPLE AND UNIX AND "${OPENSSL_ROOT_DIR}" STREQUAL "")
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@3;/usr/local/opt/openssl@1.1")
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be something like if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's inside of the if(APPLE AND UNIX AND "${OPENSSL_ROOT_DIR}" STREQUAL "") already; so it's def only going to apply to APPLE. Probably could condense this some by doing something like

if(APPLE AND UNIX AND "${OPENSSL_ROOT_DIR}" STREQUAL "" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
   #one line for arm stuff
elseif(APPLE AND UNIX AND "${OPENSSL_ROOT_DIR}" STREQUAL "")
   #one line for x86 stuff
endif()

But I suppose was trying to avoid the repetition of the APPLE AND UNIX AND "${OPENSSL_ROOT_DIR}" STREQUAL "" part.

set(OPENSSL_ROOT_DIR "/opt/homebrew/opt/openssl@3;/opt/homebrew/opt/openssl@1.1")
else()
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@3;/usr/local/opt/openssl@1.1")
endif()
endif()
# fc also adds these definitions to its public interface. once fc becomes the sole importer of openssl, this should be removed
add_definitions(-DOPENSSL_API_COMPAT=0x10100000L -DOPENSSL_NO_DEPRECATED)
Expand Down