__hidden_xmake.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. set_project("pocketpy")
  2. set_allowedplats("windows", "linux", "macosx", "wasm", "android")
  3. option("dev", {default = true, showmenu = true, description = ""})
  4. includes("dylib")
  5. add_requires("python", {kind = "binary"})
  6. add_rules("mode.debug", "mode.release")
  7. set_languages("c++17")
  8. add_cxflags("/utf-8", {tools = "cl"})
  9. add_includedirs("include")
  10. if is_plat("linux", "macosx") then
  11. add_syslinks("dl")
  12. end
  13. target("pocketpy")
  14. if has_config("dev") then
  15. set_kind("shared")
  16. else
  17. set_kind("$(kind)")
  18. end
  19. add_files("src/*.cpp")
  20. add_headerfiles("include/(**.h)")
  21. if is_plat("windows") and is_kind("shared") then
  22. add_rules("utils.symbols.export_all")
  23. end
  24. before_build(function (target)
  25. local python = assert(import("lib.detect.find_tool")("python3"), "python3 not found!")
  26. os.execv(python.program, {"prebuild.py"})
  27. end)
  28. target("main")
  29. set_kind("binary")
  30. add_files("src2/main.cpp")
  31. add_deps("pocketpy")
  32. on_load(function (target)
  33. target:set("enabled", has_config("dev"))
  34. end)