summaryrefslogtreecommitdiff
path: root/xmake/modules/lib
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-20 14:54:49 +0800
committerruki <[email protected]>2019-03-20 14:54:49 +0800
commit85deccc73a0278e01fa8580b68b38f16e0598bf7 (patch)
treea9a446a5be5ca662525df921e50ce66029bc3359 /xmake/modules/lib
parent57506c7b8ba8941ebac3676a241f8444e0079a56 (diff)
parent8bb6ddf5c40f15fe6570f73dc5c4e5295ce95180 (diff)
Merge branch 'repo' into dev
Diffstat (limited to 'xmake/modules/lib')
-rw-r--r--xmake/modules/lib/detect/check_cxsnippets.lua18
-rw-r--r--xmake/modules/lib/detect/find_package.lua1
-rw-r--r--xmake/modules/lib/detect/has_cfuncs.lua5
-rw-r--r--xmake/modules/lib/detect/has_cincludes.lua5
-rw-r--r--xmake/modules/lib/detect/has_ctypes.lua5
-rw-r--r--xmake/modules/lib/detect/has_cxxfuncs.lua5
-rw-r--r--xmake/modules/lib/detect/has_cxxincludes.lua5
-rw-r--r--xmake/modules/lib/detect/has_cxxtypes.lua5
8 files changed, 33 insertions, 16 deletions
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua
index e44043b99..48a56fe1b 100644
--- a/xmake/modules/lib/detect/check_cxsnippets.lua
+++ b/xmake/modules/lib/detect/check_cxsnippets.lua
@@ -120,7 +120,7 @@ end
-- .e.g
-- { verbose = false, target = [target|option], sourcekind = "[cc|cxx]"
-- , types = {"wchar_t", "char*"}, includes = "stdio.h", funcs = {"sigsetjmp", "sigsetjmp((void*)0, 0)"}
--- , config = {defines = "xx", cxflags = ""}}
+-- , configs = {defines = "xx", cxflags = ""}}
--
-- funcs:
-- sigsetjmp
@@ -144,11 +144,23 @@ function main(snippets, opt)
-- init snippets
snippets = snippets or {}
+ -- get configs
+ local configs = opt.configs or opt.config
+
-- get links
- local links = table.wrap(opt.links)
+ local links = {}
+ if configs and configs.links then
+ table.join2(links, configs.links)
+ end
if opt.target then
table.join2(links, opt.target:get("links"))
end
+ if configs and configs.syslinks then
+ table.join2(links, configs.syslinks)
+ end
+ if opt.target then
+ table.join2(links, opt.target:get("syslinks"))
+ end
-- get types
local types = table.wrap(opt.types)
@@ -199,7 +211,7 @@ function main(snippets, opt)
-- trace
if opt.verbose or option.get("verbose") or option.get("diagnosis") then
- local kind = ifelse(sourcekind == "cc", "c", "c++")
+ local kind = opt.sourcekind == "cc" and "c" or "c++"
if #includes > 0 then
cprint("${dim}> checking for the %s includes(%s)", kind, table.concat(includes, ", "))
end
diff --git a/xmake/modules/lib/detect/find_package.lua b/xmake/modules/lib/detect/find_package.lua
index dc9286c54..63745c48d 100644
--- a/xmake/modules/lib/detect/find_package.lua
+++ b/xmake/modules/lib/detect/find_package.lua
@@ -87,7 +87,6 @@ function main(name, opt)
if opt.verbose or option.get("verbose") then
if result then
cprint("checking for the %s ... ${color.success}%s", name, result.version and result.version or "${text.success}")
- dprint(result)
else
cprint("checking for the %s ... ${color.nothing}${text.nothing}", name)
end
diff --git a/xmake/modules/lib/detect/has_cfuncs.lua b/xmake/modules/lib/detect/has_cfuncs.lua
index 6cf8f4cd3..73ab54eca 100644
--- a/xmake/modules/lib/detect/has_cfuncs.lua
+++ b/xmake/modules/lib/detect/has_cfuncs.lua
@@ -30,7 +30,7 @@ import("lib.detect.check_cxsnippets")
-- @param funcs the funcs
-- @param opt the argument options
-- .e.g
--- { verbose = false, target = [target|option], includes = "", config = {linkdirs = .., links = .., defines = .., ..}}
+-- { verbose = false, target = [target|option], includes = "", configs = {linkdirs = .., links = .., defines = .., ..}}
--
-- funcs:
-- sigsetjmp
@@ -55,5 +55,6 @@ function main(funcs, opt)
opt.funcs = funcs
-- has funcs?
- return check_cxsnippets("", opt)
+ local name = opt.name or "has_cfuncs"
+ return check_cxsnippets({[name] = ""}, opt)
end
diff --git a/xmake/modules/lib/detect/has_cincludes.lua b/xmake/modules/lib/detect/has_cincludes.lua
index a70c17f56..195a482e1 100644
--- a/xmake/modules/lib/detect/has_cincludes.lua
+++ b/xmake/modules/lib/detect/has_cincludes.lua
@@ -30,7 +30,7 @@ import("lib.detect.check_cxsnippets")
-- @param includes the includes
-- @param opt the argument options
-- .e.g
--- { verbose = false, target = [target|option], config = {defines = "..", .. }}
+-- { verbose = false, target = [target|option], configs = {defines = "..", .. }}
--
-- @return true or false
--
@@ -49,5 +49,6 @@ function main(includes, opt)
opt.includes = includes
-- has includes?
- return check_cxsnippets("", opt)
+ local name = opt.name or "has_cincludes"
+ return check_cxsnippets({[name] = ""}, opt)
end
diff --git a/xmake/modules/lib/detect/has_ctypes.lua b/xmake/modules/lib/detect/has_ctypes.lua
index 2341b983d..2ac05a30e 100644
--- a/xmake/modules/lib/detect/has_ctypes.lua
+++ b/xmake/modules/lib/detect/has_ctypes.lua
@@ -30,7 +30,7 @@ import("lib.detect.check_cxsnippets")
-- @param types the types
-- @param opt the argument options
-- .e.g
--- { verbose = false, target = [target|option], includes = .., config = {defines = .., ..}}
+-- { verbose = false, target = [target|option], includes = .., configs = {defines = .., ..}}
--
-- @return true or false
--
@@ -49,5 +49,6 @@ function main(types, opt)
opt.types = types
-- has types?
- return check_cxsnippets("", opt)
+ local name = opt.name or "has_ctypes"
+ return check_cxsnippets({[name] = ""}, opt)
end
diff --git a/xmake/modules/lib/detect/has_cxxfuncs.lua b/xmake/modules/lib/detect/has_cxxfuncs.lua
index 0ee26c897..e30a21416 100644
--- a/xmake/modules/lib/detect/has_cxxfuncs.lua
+++ b/xmake/modules/lib/detect/has_cxxfuncs.lua
@@ -30,7 +30,7 @@ import("lib.detect.check_cxsnippets")
-- @param funcs the funcs
-- @param opt the argument options
-- .e.g
--- { verbose = false, target = [target|option], includes = "", config = {linkdirs = .., links = .., defines = .., ..}}
+-- { verbose = false, target = [target|option], includes = "", configs = {linkdirs = .., links = .., defines = .., ..}}
--
-- funcs:
-- sigsetjmp
@@ -55,5 +55,6 @@ function main(funcs, opt)
opt.funcs = funcs
-- has funcs?
- return check_cxsnippets("", opt)
+ local name = opt.name or "has_cxxfuncs"
+ return check_cxsnippets({[name] = ""}, opt)
end
diff --git a/xmake/modules/lib/detect/has_cxxincludes.lua b/xmake/modules/lib/detect/has_cxxincludes.lua
index 57c08ddb6..6c4846134 100644
--- a/xmake/modules/lib/detect/has_cxxincludes.lua
+++ b/xmake/modules/lib/detect/has_cxxincludes.lua
@@ -30,7 +30,7 @@ import("lib.detect.check_cxsnippets")
-- @param includes the includes
-- @param opt the argument options
-- .e.g
--- { verbose = false, target = [target|option], config = {defines = "..", .. }}
+-- { verbose = false, target = [target|option], configs = {defines = "..", .. }}
--
-- @return true or false
--
@@ -49,5 +49,6 @@ function main(includes, opt)
opt.includes = includes
-- has includes?
- return check_cxsnippets("", opt)
+ local name = opt.name or "has_cxxincludes"
+ return check_cxsnippets({[name] = ""}, opt)
end
diff --git a/xmake/modules/lib/detect/has_cxxtypes.lua b/xmake/modules/lib/detect/has_cxxtypes.lua
index 1011a4b5f..f52cee697 100644
--- a/xmake/modules/lib/detect/has_cxxtypes.lua
+++ b/xmake/modules/lib/detect/has_cxxtypes.lua
@@ -30,7 +30,7 @@ import("lib.detect.check_cxsnippets")
-- @param types the types
-- @param opt the argument options
-- .e.g
--- { verbose = false, target = [target|option], includes = .., config = {defines = .., ..}}
+-- { verbose = false, target = [target|option], includes = .., configs = {defines = .., ..}}
--
-- @return true or false
--
@@ -49,5 +49,6 @@ function main(types, opt)
opt.types = types
-- has types?
- return check_cxsnippets("", opt)
+ local name = opt.name or "has_cxxtypes"
+ return check_cxsnippets({[name] = ""}, opt)
end