xmake.lua 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. add_rules("mode.release", "mode.debug")
  2. option("gmp", {default = false, defines = "WITH_GMP"})
  3. if has_config("gmp") then
  4. add_requires("gmp")
  5. end
  6. target("libs7") do
  7. set_kind("$(kind)")
  8. set_basename("s7")
  9. add_files("s7.c")
  10. add_headerfiles("s7.h")
  11. add_includedirs(".", {public = true})
  12. add_options("gmp")
  13. if is_plat("windows") then
  14. set_languages("c11")
  15. end
  16. add_packages("gmp")
  17. if is_mode("debug") then
  18. add_defines("S7_DEBUGGING")
  19. end
  20. end
  21. target("s7") do
  22. set_kind("binary")
  23. add_defines("WITH_MAIN")
  24. add_files("s7.c")
  25. add_headerfiles("s7.h")
  26. add_includedirs(".", {public = true})
  27. add_options("gmp")
  28. if is_plat("windows") then
  29. set_languages("c11")
  30. end
  31. add_packages("gmp")
  32. if is_mode("debug") then
  33. add_defines("S7_DEBUGGING")
  34. end
  35. if not is_plat("macosx") then
  36. add_ldflags("-static", "-static-libgcc", {force = true})
  37. end
  38. if is_plat("linux") then
  39. add_syslinks("pthread", "dl", "m")
  40. end
  41. end