2
0

xmake.lua 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. set_allowedplats("windows", "linux", "macosx", "mingw", "cross")
  2. option("libzip", {showmenu = true, default = false})
  3. option("minizip_ng", {showmenu = true, default = false})
  4. option("wide", {showmenu = true, default = false})
  5. add_rules("mode.debug", "mode.release")
  6. if has_config("wide") then
  7. add_requires("expat", {configs = {char_type = "wchar_t"}})
  8. else
  9. add_requires("expat")
  10. end
  11. if has_config("libzip") then
  12. add_requires("libzip")
  13. elseif has_config("minizip_ng") then
  14. add_requires("minizip-ng", {configs = {zlib = true}})
  15. else
  16. add_requires("minizip")
  17. end
  18. target("xlsxio")
  19. set_kind("$(kind)")
  20. add_files("lib/*.c")
  21. add_includedirs("include")
  22. add_headerfiles("include/*.h")
  23. add_defines("BUILD_XLSXIO")
  24. if is_kind("shared") then
  25. add_defines("BUILD_XLSXIO_SHARED", {public = true})
  26. else
  27. add_defines("BUILD_XLSXIO_STATIC", {public = true})
  28. end
  29. if has_config("wide") then
  30. add_defines("XML_UNICODE", {public = true})
  31. end
  32. if is_plat("linux", "bsd") then
  33. add_syslinks("pthread")
  34. end
  35. if has_config("libzip") then
  36. add_defines("USE_LIBZIP")
  37. add_packages("libzip")
  38. else
  39. add_defines("USE_MINIZIP")
  40. if has_config("minizip_ng") then
  41. add_defines("USE_MINIZIP_NG")
  42. add_packages("minizip-ng")
  43. else
  44. add_packages("minizip")
  45. end
  46. end
  47. add_packages("expat")