xmake.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. set_project("theora")
  2. set_kind("$(kind)")
  3. add_rules("mode.debug", "mode.release")
  4. if is_plat("windows") and is_kind("shared") then
  5. add_rules("utils.symbols.export_all")
  6. end
  7. add_requires("libogg")
  8. add_packages("libogg")
  9. add_includedirs("include")
  10. add_headerfiles("include/(theora/*.h)")
  11. set_warnings("all")
  12. target("theoraenc")
  13. add_files("lib/apiwrapper.c",
  14. "lib/fragment.c",
  15. "lib/idct.c",
  16. "lib/internal.c",
  17. "lib/info.c",
  18. "lib/state.c",
  19. "lib/quant.c",
  20. "lib/analyze.c",
  21. "lib/encfrag.c",
  22. "lib/encapiwrapper.c",
  23. "lib/encinfo.c",
  24. "lib/encode.c",
  25. "lib/enquant.c",
  26. "lib/fdct.c",
  27. "lib/huffenc.c",
  28. "lib/mathops.c",
  29. "lib/mcenc.c",
  30. "lib/rate.c",
  31. "lib/tokenize.c")
  32. local asmdir = is_plat("windows") and "x86_vc" or "x86"
  33. if is_arch("x86") then
  34. add_defines("OC_X86_ASM")
  35. add_files(path.join("lib", asmdir, "*.c|sse2fdct.c"))
  36. elseif is_arch("x64", "x86_64") and not is_plat("windows") then
  37. add_defines("OC_X86_ASM", "OC_X86_64_ASM")
  38. add_files(path.join("lib", asmdir, "*.c"))
  39. end
  40. target("theoradec")
  41. add_files("lib/apiwrapper.c",
  42. "lib/bitpack.c",
  43. "lib/decapiwrapper.c",
  44. "lib/decinfo.c",
  45. "lib/decode.c",
  46. "lib/dequant.c",
  47. "lib/fragment.c",
  48. "lib/huffdec.c",
  49. "lib/idct.c",
  50. "lib/info.c",
  51. "lib/internal.c",
  52. "lib/quant.c",
  53. "lib/state.c")
  54. local asmdir = is_plat("windows") and "x86_vc" or "x86"
  55. if is_arch("x86") or (not is_plat("windows") and is_arch("x64", "x86_64")) then
  56. add_defines("OC_X86_ASM")
  57. add_files(path.join("lib", asmdir, "mmxidct.c"),
  58. path.join("lib", asmdir, "mmxfrag.c"),
  59. path.join("lib", asmdir, "mmxstate.c"),
  60. path.join("lib", asmdir, "x86state.c"))
  61. if os.exists("lib", asmdir, "sse2idct.c") then
  62. add_files("lib", asmdir, "sse2idct.c")
  63. end
  64. if os.exists(path.join("lib", asmdir, "x86cpu.c")) then
  65. add_files(path.join("lib", asmdir, "x86cpu.c"))
  66. end
  67. if is_arch("x64", "x86_64") then
  68. add_defines("OC_X86_64_ASM")
  69. end
  70. end