xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package("pycdc")
  2. set_homepage("https://github.com/zrax/pycdc")
  3. set_description("C++ python bytecode disassembler and decompiler")
  4. add_urls("https://github.com/zrax/pycdc.git")
  5. add_versions("2022.10.04", "44a730f3a889503014fec94ae6e62d8401cb75e5")
  6. add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
  7. add_deps("cmake")
  8. add_deps("python", {kind = "binary"})
  9. on_install("macosx", "linux", "windows", function (package)
  10. local configs = {}
  11. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  12. import("package.tools.cmake").install(package, configs, {buildir = "build"})
  13. os.cp("*.h", package:installdir("include"))
  14. os.trycp("build/*.a", package:installdir("lib"))
  15. os.trycp("build/*.lib", package:installdir("lib"))
  16. package:addenv("PATH", "bin")
  17. end)
  18. on_test(function (package)
  19. if not package:is_cross() then
  20. os.run("pycdc --help")
  21. os.run("pycdas --help")
  22. end
  23. assert(package:check_cxxsnippets({test = [[
  24. #include "ASTree.h"
  25. void test() {
  26. PycModule mod;
  27. mod.loadFromFile("");
  28. }
  29. ]]}, {configs = {languages = "c++11"}}))
  30. end)