xmake.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. option("export_symbol", {default = false})
  2. add_rules("mode.debug", "mode.release")
  3. target("llhttp")
  4. set_kind("$(kind)")
  5. add_files("src/*.c")
  6. add_includedirs("include")
  7. add_headerfiles("include/llhttp.h")
  8. if has_config("export_symbol") and is_kind("shared") and is_plat("windows") then
  9. local funcs = {
  10. "llhttp_init",
  11. "llhttp_settings_init",
  12. "llhttp_execute",
  13. "llhttp_finish",
  14. "llhttp_message_needs_eof",
  15. "llhttp_should_keep_alive",
  16. "llhttp_pause",
  17. "llhttp_resume",
  18. "llhttp_resume_after_upgrade",
  19. "llhttp_get_errno",
  20. "llhttp_get_error_reason",
  21. "llhttp_set_error_reason",
  22. "llhttp_get_error_pos",
  23. "llhttp_errno_name",
  24. "llhttp_method_name",
  25. "llhttp_set_lenient_headers",
  26. "llhttp_set_lenient_chunked_length"
  27. }
  28. for _, func in ipairs(funcs) do
  29. add_shflags("/export:" .. func)
  30. end
  31. end