Skip to content

Commit

Permalink
#5628 Link Synergy core against OpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Nelless committed Sep 29, 2016
1 parent 52c8763 commit 5db78ac
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 7 deletions.
32 changes: 32 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,38 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

if (WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(OPENSSL_PLAT_DIR openssl-win64)
else()
set(OPENSSL_PLAT_DIR openssl-win32)
endif()
set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/inc32)
endif()

if (APPLE)
set(OPENSSL_PLAT_DIR openssl-osx)
set(OPENSSL_INCLUDE ${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/include)
endif()

if (WIN32)
set(OPENSSL_LIBS
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/out32dll/libeay32.lib
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/out32dll/ssleay32.lib
)
endif()

if (UNIX)
if (APPLE)
set(OPENSSL_LIBS
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libssl.a
${CMAKE_SOURCE_DIR}/ext/${OPENSSL_PLAT_DIR}/libcrypto.a
)
else()
set(OPENSSL_LIBS ssl crypto)
endif()
endif()

add_subdirectory(lib)
add_subdirectory(cmd)
add_subdirectory(micro)
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/synergyc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ endif()

add_executable(synergyc ${sources})
target_link_libraries(synergyc
arch base client common io mt net ipc platform server synergy ${libs})
arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS})

if (CONF_CPACK)
install(TARGETS
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/synergyd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else()
endif()

target_link_libraries(synergyd
arch base common io ipc mt net platform synergy ${libs})
arch base common io ipc mt net platform synergy ${libs} ${OPENSSL_LIBS})

if (CONF_CPACK)
install(TARGETS
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/synergyp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ else()
endif()

target_link_libraries(synergyp
arch base client common io mt net ipc platform server synergy client ${libs})
arch base client common io mt net ipc platform server synergy client ${libs} ${OPENSSL_LIBS})

if (CONF_CPACK)
install(TARGETS
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/synergys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ endif()

add_executable(synergys ${sources})
target_link_libraries(synergys
arch base client common io mt net ipc platform server synergy ${libs})
arch base client common io mt net ipc platform server synergy ${libs} ${OPENSSL_LIBS})

if (CONF_CPACK)
install(TARGETS
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/syntool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()

add_executable(syntool ${sources})
target_link_libraries(syntool
synergy arch base client common io ipc mt net platform server ${libs})
synergy arch base client common io ipc mt net platform server ${libs} ${OPENSSL_LIBS})

if (CONF_CPACK)
install(TARGETS
Expand Down
1 change: 1 addition & 0 deletions src/lib/net/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ endif()

include_directories(
../
${OPENSSL_INCLUDE}
)

if (UNIX)
Expand Down
2 changes: 1 addition & 1 deletion src/test/integtests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ endif()

add_executable(integtests ${sources})
target_link_libraries(integtests
arch base client common io ipc mt net platform server synergy gtest gmock ${libs})
arch base client common io ipc mt net platform server synergy gtest gmock ${libs} ${OPENSSL_LIBS})
2 changes: 1 addition & 1 deletion src/test/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ endif()

add_executable(unittests ${sources})
target_link_libraries(unittests
arch base client server common io net platform server synergy mt ipc gtest gmock ${libs})
arch base client server common io net platform server synergy mt ipc gtest gmock ${libs} ${OPENSSL_LIBS})

0 comments on commit 5db78ac

Please sign in to comment.