This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

#5628 Link Synergy core against OpenSSL

  • Loading branch information...
nlyan committed Sep 27, 2016
1 parent 52c8763 commit 5db78acab4da367a9bd42997e769ae631e086391
View
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -23,6 +23,7 @@ endif()
include_directories(
../
+ ${OPENSSL_INCLUDE}
)
if (UNIX)
@@ -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})
@@ -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.