xmake.lua 832 B

1234567891011121314151617181920212223242526
  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. add_urls("https://github.com/troydhanson/uthash.git")
  6. add_versions("2023.7.11", "ca98384ce7f30beb216f9a0bc88a3b4340ead729")
  7. on_install(function (package)
  8. os.cp("src/*.h", package:installdir("include"))
  9. end)
  10. on_test(function (package)
  11. assert(package:check_csnippets({test = [[
  12. #include <uthash.h>
  13. struct my_struct {
  14. int id;
  15. char name[10];
  16. UT_hash_handle hh;
  17. };
  18. struct my_struct *users = NULL;
  19. void test(struct my_struct *s) {
  20. HASH_ADD_INT( users, id, s );
  21. }
  22. ]]}))
  23. end)