xmake.lua 930 B

12345678910111213141516171819202122232425262728
  1. package("uthash")
  2. set_kind("library", {headeronly = true})
  3. set_homepage("https://troydhanson.github.io/uthash")
  4. set_description("C macros for hash tables and more")
  5. set_license("BSD")
  6. add_urls("https://github.com/troydhanson/uthash.git")
  7. add_versions("2025.05.05", "af6e637f19c102167fb914b9ebcc171389270b48")
  8. add_versions("2023.7.11", "ca98384ce7f30beb216f9a0bc88a3b4340ead729")
  9. on_install(function (package)
  10. os.cp("src/*.h", package:installdir("include"))
  11. end)
  12. on_test(function (package)
  13. assert(package:check_csnippets({test = [[
  14. #include <uthash.h>
  15. struct my_struct {
  16. int id;
  17. char name[10];
  18. UT_hash_handle hh;
  19. };
  20. struct my_struct *users = NULL;
  21. void test(struct my_struct *s) {
  22. HASH_ADD_INT( users, id, s );
  23. }
  24. ]]}))
  25. end)