summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2019-03-15 22:42:41 +0800
committerruki <[email protected]>2019-03-15 10:16:08 +0800
commitcc02a8d5a54dd46a63f0da144cfb35b12dcf3263 (patch)
tree826251e1187012ba02d8506771f138711d716088 /xmake/modules
parent9036abe2d5d282bd19c9f6bdd2acee9ac03051fc (diff)
add opt.name for has_xxx
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/lib/detect/check_cxsnippets.lua2
-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
7 files changed, 19 insertions, 13 deletions
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua
index 5ef642f09..3eff70a0c 100644
--- a/xmake/modules/lib/detect/check_cxsnippets.lua
+++ b/xmake/modules/lib/detect/check_cxsnippets.lua
@@ -199,7 +199,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/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