xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. add_rules("mode.debug", "mode.release")
  2. option("stdcall")
  3. set_default(false)
  4. set_description("Build using stdcall")
  5. add_defines("BEA_USE_STDCALL")
  6. option_end()
  7. option("lite")
  8. set_default(false)
  9. set_description("Build without text disassembly")
  10. add_defines("BEA_LIGHT_DISASSEMBLY")
  11. option_end()
  12. add_requires("zlib")
  13. target("BeaEngine")
  14. set_languages("c99")
  15. set_kind("$(kind)")
  16. add_files("src/BeaEngine.c")
  17. add_includedirs("include", "src")
  18. add_headerfiles("include/(beaengine/*.h)")
  19. add_packages("zlib")
  20. set_warnings("all", "extra")
  21. if is_plat("windows") then
  22. add_defines("_CRT_SECURE_NO_WARNINGS")
  23. add_defines("BEA_LACKS_SNPRINTF")
  24. end
  25. on_config(function (target)
  26. local suffix = ""
  27. local kind = target:kind()
  28. if kind == "shared" then
  29. target:add("defines", "BUILD_BEA_ENGINE_DLL")
  30. else
  31. target:add("defines", "BEA_ENGINE_STATIC")
  32. suffix = suffix .. "_s"
  33. end
  34. if is_mode("debug") then
  35. suffix = suffix .. "_d"
  36. end
  37. if not has_config("lite") then
  38. suffix = suffix .. "_l"
  39. end
  40. if has_config("stdcall") then
  41. suffix = suffix .. "_stdcall"
  42. end
  43. if target:is_arch("x64", "x86_64") then
  44. suffix = suffix .. "_64"
  45. end
  46. target:set("suffixname", suffix)
  47. end)