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.

66 lines
1.6 KiB

  1. From a88d7f4348e54abba47a96f9ec4ffe7c60ba9400 Mon Sep 17 00:00:00 2001
  2. From: O <codetypes@gmail.com>
  3. Date: Fri, 30 Jul 2021 17:17:45 +0800
  4. Subject: [PATCH] build so file on mac
  5. ---
  6. CMakeLists.txt | 18 +++++++++++++-----
  7. 1 file changed, 13 insertions(+), 5 deletions(-)
  8. --- a/CMakeLists.txt
  9. +++ b/CMakeLists.txt
  10. @@ -20,7 +20,7 @@ find_package(Threads REQUIRED)
  11. add_definitions(-DPTHREADS)
  12. if(BUILD_SHARED_LUA_OPENSSL)
  13. - set(LUA_OPENSSL_LIBTYPE SHARED)
  14. + set(LUA_OPENSSL_LIBTYPE MODULE)
  15. if(WIN32)
  16. add_definitions(-DLUA_BUILD_AS_DLL)
  17. set(EXTRA_LIBS "ws2_32.lib" "crypt32.lib")
  18. @@ -45,7 +45,7 @@ add_library(lua-openssl ${LUA_OPENSSL_LI
  19. src/dsa.c
  20. src/ec.c
  21. src/engine.c
  22. - src/mac.c
  23. + src/hmac.c
  24. src/lbn.c
  25. src/lhash.c
  26. src/misc.c
  27. @@ -73,7 +73,7 @@ add_library(lua-openssl ${LUA_OPENSSL_LI
  28. target_include_directories(lua-openssl PUBLIC
  29. ${OPENSSL_INCLUDE_DIR}
  30. - ${LUA_INCLUDE_DIRS}
  31. + ${LUA_INCLUDE_DIR}
  32. deps
  33. deps/lua-compat/c-api
  34. deps/auxiliar
  35. @@ -81,17 +81,25 @@ target_include_directories(lua-openssl P
  36. target_link_libraries(lua-openssl PUBLIC
  37. ${OPENSSL_LIBRARIES}
  38. - ${LUA_LIBRARIES}
  39. ${EXTRA_LIBS}
  40. Threads::Threads
  41. )
  42. +if(WIN32)
  43. + target_link_libraries(lua-openssl PUBLIC
  44. + ${LUA_LIBRARIES}
  45. + )
  46. +endif()
  47. +
  48. +if(APPLE)
  49. + target_link_options(lua-openssl PUBLIC -bundle -undefined dynamic_lookup)
  50. +endif()
  51. +
  52. target_compile_options(lua-openssl PRIVATE -DLUA_LIB)
  53. set_target_properties(lua-openssl PROPERTIES
  54. PREFIX ""
  55. OUTPUT_NAME "openssl"
  56. - VERSION 0.8.0.0 SOVERSION 0
  57. )
  58. install(TARGETS lua-openssl