premake5.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. project "curl-lib"
  2. language "C"
  3. kind "StaticLib"
  4. sysincludedirs { "include" }
  5. includedirs { "lib", "../mbedtls/include" }
  6. defines { "BUILDING_LIBCURL", "CURL_STATICLIB", "HTTP_ONLY" }
  7. warnings "off"
  8. if not _OPTIONS["no-zlib"] then
  9. defines { 'USE_ZLIB' }
  10. includedirs { '../zlib' }
  11. end
  12. files
  13. {
  14. "**.h",
  15. "**.c"
  16. }
  17. filter { "system:windows" }
  18. defines { "USE_SCHANNEL", "USE_WINDOWS_SSPI" }
  19. links "crypt32"
  20. filter { "system:macosx" }
  21. defines { "USE_DARWINSSL" }
  22. filter { "system:not windows", "system:not macosx" }
  23. defines { "USE_MBEDTLS" }
  24. filter { "system:linux or bsd or solaris" }
  25. defines { "CURL_HIDDEN_SYMBOLS" }
  26. -- find the location of the ca bundle
  27. local ca = nil
  28. for _, f in ipairs {
  29. "/etc/ssl/certs/ca-certificates.crt",
  30. "/etc/pki/tls/certs/ca-bundle.crt",
  31. "/usr/share/ssl/certs/ca-bundle.crt",
  32. "/usr/local/share/certs/ca-root.crt",
  33. "/usr/local/share/certs/ca-root-nss.crt",
  34. "/etc/certs/ca-certificates.crt",
  35. "/etc/ssl/cert.pem" } do
  36. if os.isfile(f) then
  37. ca = f
  38. break
  39. end
  40. end
  41. if ca then
  42. defines { 'CURL_CA_BUNDLE="' .. ca .. '"' }
  43. end