浏览代码

improve has_funcs

ruki 6 年之前
父节点
当前提交
bb0960de91

+ 1 - 1
packages/l/lua/xmake.lua

@@ -44,5 +44,5 @@ package("lua")
 
 
     on_test(function (package)
     on_test(function (package)
         os.vrun("lua -e \"print('hello xmake!')\"")
         os.vrun("lua -e \"print('hello xmake!')\"")
-        assert(import("lib.detect.has_cfuncs")("lua_getinfo", {configs = package:fetch(), includes = "lua.h"}))
+        assert(package:has_cfuncs("lua_getinfo", {includes = "lua.h"}))
     end)
     end)

+ 1 - 1
packages/l/luajit/xmake.lua

@@ -48,5 +48,5 @@ package("luajit")
     on_test(function (package)
     on_test(function (package)
         print(os.getenv("PATH"))
         print(os.getenv("PATH"))
         os.vrun("luajit -e \"print('hello xmake!')\"")
         os.vrun("luajit -e \"print('hello xmake!')\"")
-        assert(import("lib.detect.has_cfuncs")("lua_pcall", {configs = package:fetch(), includes = "luajit.h"}))
+        assert(package:has_cfuncs("lua_pcall", {includes = "luajit.h"}))
     end)
     end)

+ 1 - 1
packages/p/pcre/xmake.lua

@@ -62,5 +62,5 @@ package("pcre")
     on_test(function (package)
     on_test(function (package)
         local bitwidth = package:config("bitwidth") or "8"
         local bitwidth = package:config("bitwidth") or "8"
         local testfunc = string.format("pcre%s_compile", bitwidth ~= "8" and bitwidth or "")
         local testfunc = string.format("pcre%s_compile", bitwidth ~= "8" and bitwidth or "")
-        assert(import("lib.detect.has_cfuncs")(testfunc, {configs = package:fetch(), includes = "pcre.h"}))
+        assert(package:has_cfuncs(testfunc, {includes = "pcre.h"}))
     end)
     end)

+ 1 - 1
packages/p/pcre2/xmake.lua

@@ -64,5 +64,5 @@ package("pcre2")
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
-        assert(import("lib.detect.has_cfuncs")("pcre2_compile", {configs = package:fetch(), includes = "pcre2.h"}))
+        assert(package:has_cfuncs("pcre2_compile", {includes = "pcre2.h"}))
     end)
     end)

+ 1 - 1
packages/s/sqlite3/xmake.lua

@@ -22,5 +22,5 @@ package("sqlite3")
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
-        assert(import("lib.detect.has_cfuncs")("sqlite3_open_v2", {configs = package:fetch(), includes = "sqlite3.h"}))
+        assert(package:has_cfuncs("sqlite3_open_v2", {includes = "sqlite3.h"}))
     end)
     end)

+ 1 - 1
packages/t/tbox/xmake.lua

@@ -51,5 +51,5 @@ package("tbox")
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
-        assert(import("lib.detect.has_cfuncs")("tb_exit", {configs = package:fetch(), includes = "tbox/tbox.h"}))
+        assert(package:has_cfuncs("tb_exit", {includes = "tbox/tbox.h"}))
     end)
     end)

+ 1 - 1
packages/z/zlib/xmake.lua

@@ -21,5 +21,5 @@ package("zlib")
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
-        assert(import("lib.detect.has_cfuncs")("inflate", {configs = package:fetch(), includes = "zlib.h"}))
+        assert(package:has_cfuncs("inflate", {includes = "zlib.h"}))
     end)
     end)