xmake.lua 1.2 KB

12345678910111213141516171819202122232425262728
  1. package("highs")
  2. set_homepage("https://github.com/ERGO-Code/HiGHS")
  3. set_description("Linear optimization software")
  4. set_license("MIT")
  5. add_urls("https://github.com/ERGO-Code/HiGHS/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/ERGO-Code/HiGHS.git")
  7. add_versions("v1.5.3", "ce1a7d2f008e60cc69ab06f8b16831bd0fcd5f6002d3bbebae9d7a3513a1d01d")
  8. if is_plat("linux", "bsd") then
  9. add_syslinks("m", "pthread")
  10. end
  11. add_includedirs("include", "include/highs")
  12. add_deps("cmake", "zlib >=1.2.3")
  13. on_install("windows|x64", "windows|x86", "linux", "macosx", "bsd", "mingw", "msys", "iphoneos", "cross", "wasm", function (package)
  14. local configs = {"-DBUILD_TESTING=OFF", "-DCI=OFF", "-DBUILD_EXAMPLES=OFF"}
  15. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  16. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  17. import("package.tools.cmake").install(package, configs)
  18. end)
  19. on_test(function (package)
  20. assert(package:has_cfuncs("Highs_addCol", {includes = "highs/interfaces/highs_c_api.h"}))
  21. end)