Skip to content

Commit

Permalink
Merge pull request #80 from littleSand/fix
Browse files Browse the repository at this point in the history
fix: Fix error OPENSSL when build on Ubuntu
  • Loading branch information
sumoprojects committed Feb 26, 2018
2 parents 9376299 + 175f379 commit 054fd7d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,29 @@ if (UNIX AND NOT APPLE)
find_package(Threads)
endif()

# Handle OpenSSL, used for sha256sum on binary updates and light wallet ssl http
if (CMAKE_SYSTEM_NAME MATCHES "(SunOS|Solaris)")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads")
endif ()

if (APPLE AND NOT IOS)
if (NOT OpenSSL_DIR)
EXECUTE_PROCESS(COMMAND brew --prefix openssl
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Using OpenSSL found at ${OPENSSL_ROOT_DIR}")
endif()
endif()

find_package(OpenSSL REQUIRED)
message(STATUS "Using OpenSSL include dir at ${OPENSSL_INCLUDE_DIR}")
include_directories(${OPENSSL_INCLUDE_DIR})
if(STATIC AND NOT IOS)
if(UNIX)
set(OPENSSL_LIBRARIES "${OPENSSL_LIBRARIES};${CMAKE_DL_LIBS};${CMAKE_THREAD_LIBS_INIT}")
endif()
endif()

add_subdirectory(external)

# Final setup for miniupnpc
Expand Down
1 change: 1 addition & 0 deletions src/daemon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ target_link_libraries(daemon
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${OPENSSL_LIBRARIES}
${EXTRA_LIBRARIES})
add_dependencies(daemon version)
set_property(TARGET daemon
Expand Down
1 change: 1 addition & 0 deletions src/simplewallet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ target_link_libraries(simplewallet
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${OPENSSL_LIBRARIES}
${EXTRA_LIBRARIES})
add_dependencies(simplewallet
version)
Expand Down
1 change: 1 addition & 0 deletions src/wallet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ if (NOT BUILD_GUI_DEPS)
${Boost_FILESYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${OPENSSL_LIBRARIES}
${EXTRA_LIBRARIES})
add_dependencies(wallet_rpc_server version)
set_property(TARGET wallet_rpc_server
Expand Down

0 comments on commit 054fd7d

Please sign in to comment.