You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.7 KiB

  1. From f7d5cb83826c7e2b1a3dc618b434d85df130a4d5 Mon Sep 17 00:00:00 2001
  2. From: James Taylor <james@jtaylor.id.au>
  3. Date: Tue, 10 Dec 2019 21:58:45 +1100
  4. Subject: [PATCH] Explicitly link against WSLAY when available
  5. When other libraries attempt to link against libh2o and libh2o-evloop that was
  6. compiled with libwslay available, there are errors from missing symbols
  7. associated with code which makes use of the wslay library. To rectify this,
  8. explicitly link against libwslay during the build process.
  9. Fixes #2105
  10. Signed-off-by: James Taylor <james@jtaylor.id.au>
  11. ---
  12. CMakeLists.txt | 12 ++++++++++--
  13. 1 file changed, 10 insertions(+), 2 deletions(-)
  14. diff --git a/CMakeLists.txt b/CMakeLists.txt
  15. index a68613081..13c2f8a9f 100644
  16. --- a/CMakeLists.txt
  17. +++ b/CMakeLists.txt
  18. @@ -519,13 +519,21 @@ SET_TARGET_PROPERTIES(libh2o PROPERTIES
  19. OUTPUT_NAME h2o
  20. VERSION ${LIBRARY_VERSION}
  21. SOVERSION ${LIBRARY_SOVERSION})
  22. -TARGET_LINK_LIBRARIES(libh2o ${LIBUV_LIBRARIES} ${EXTRA_LIBS})
  23. +IF (WSLAY_FOUND)
  24. + TARGET_LINK_LIBRARIES(libh2o ${WSLAY_LIBRARIES} ${LIBUV_LIBRARIES} ${EXTRA_LIBS})
  25. +ELSE ()
  26. + TARGET_LINK_LIBRARIES(libh2o ${LIBUV_LIBRARIES} ${EXTRA_LIBS})
  27. +ENDIF (WSLAY_FOUND)
  28. SET_TARGET_PROPERTIES(libh2o-evloop PROPERTIES
  29. OUTPUT_NAME h2o-evloop
  30. COMPILE_FLAGS "-DH2O_USE_LIBUV=0"
  31. VERSION ${LIBRARY_VERSION}
  32. SOVERSION ${LIBRARY_SOVERSION})
  33. -TARGET_LINK_LIBRARIES(libh2o-evloop ${EXTRA_LIBS})
  34. +IF (WSLAY_FOUND)
  35. + TARGET_LINK_LIBRARIES(libh2o-evloop ${WSLAY_LIBRARIES} ${EXTRA_LIBS})
  36. +ELSE ()
  37. + TARGET_LINK_LIBRARIES(libh2o-evloop ${EXTRA_LIBS})
  38. +ENDIF (WSLAY_FOUND)
  39. TARGET_INCLUDE_DIRECTORIES(libh2o PUBLIC ${OPENSSL_INCLUDE_DIR})
  40. TARGET_INCLUDE_DIRECTORIES(libh2o-evloop PUBLIC ${OPENSSL_INCLUDE_DIR})