summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-02-05 00:46:45 +0800
committerruki <[email protected]>2019-02-04 22:40:33 +0800
commit9b0e2b87b998b58788f3256c20ffc23f0b49190a (patch)
treedf037bda21f2e0da055ec363847be7f8cdd9ad10
parent631ea0396a19a6b39006a5368eb222d9eb382c5c (diff)
fix check xxx bug
-rw-r--r--xmake/includes/check_cfuncs.lua8
-rw-r--r--xmake/includes/check_cincludes.lua14
-rw-r--r--xmake/includes/check_csnippets.lua8
-rw-r--r--xmake/includes/check_ctypes.lua8
-rw-r--r--xmake/includes/check_cxxfuncs.lua8
-rw-r--r--xmake/includes/check_cxxincludes.lua14
-rw-r--r--xmake/includes/check_cxxsnippets.lua8
-rw-r--r--xmake/includes/check_cxxtypes.lua8
-rw-r--r--xmake/includes/check_features.lua8
-rw-r--r--xmake/includes/check_links.lua8
10 files changed, 48 insertions, 44 deletions
diff --git a/xmake/includes/check_cfuncs.lua b/xmake/includes/check_cfuncs.lua
index 1fd641f84..3690e32bc 100644
--- a/xmake/includes/check_cfuncs.lua
+++ b/xmake/includes/check_cfuncs.lua
@@ -37,7 +37,7 @@
--
function check_cfuncs(definition, funcs, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cfuncs(funcs)
add_defines(definition)
if opt.links then
@@ -56,7 +56,7 @@ function check_cfuncs(definition, funcs, opt)
add_cxflags(opt.cxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check c funcs and add macro definition to the configuration files
@@ -68,7 +68,7 @@ end
--
function configvar_check_cfuncs(definition, funcs, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cfuncs(funcs)
set_configvar(definition, 1)
if opt.links then
@@ -87,5 +87,5 @@ function configvar_check_cfuncs(definition, funcs, opt)
add_cxflags(opt.cxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_cincludes.lua b/xmake/includes/check_cincludes.lua
index a2ddba601..2fbf1f737 100644
--- a/xmake/includes/check_cincludes.lua
+++ b/xmake/includes/check_cincludes.lua
@@ -29,12 +29,13 @@
-- check_cincludes("HAS_STRING_H", "string.h")
-- check_cincludes("HAS_STRING_AND_STDIO_H", {"string.h", "stdio.h"})
--
-function check_cincludes(definition, includes)
- option(definition)
+function check_cincludes(definition, includes, opt)
+ opt = opt or {}
+ option(opt.name or definition)
add_cincludes(includes)
add_defines(definition)
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check include c files and add macro definition to the configuration files
@@ -44,10 +45,11 @@ end
-- configvar_check_cincludes("HAS_STRING_H", "string.h")
-- configvar_check_cincludes("HAS_STRING_AND_STDIO_H", {"string.h", "stdio.h"})
--
-function configvar_check_cincludes(definition, includes)
- option(definition)
+function configvar_check_cincludes(definition, includes, opt)
+ opt = opt or {}
+ option(opt.name or definition)
add_cincludes(includes)
set_configvar(definition, 1)
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_csnippets.lua b/xmake/includes/check_csnippets.lua
index 9e1e12448..367d1e3b1 100644
--- a/xmake/includes/check_csnippets.lua
+++ b/xmake/includes/check_csnippets.lua
@@ -30,7 +30,7 @@
--
function check_csnippets(definition, snippets, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_csnippets(definition, snippets)
add_defines(definition)
if opt.links then
@@ -49,7 +49,7 @@ function check_csnippets(definition, snippets, opt)
add_cxflags(opt.cxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check c snippets and add macro definition to the configuration snippets
@@ -60,7 +60,7 @@ end
--
function configvar_check_csnippets(definition, snippets, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_csnippets(definition, snippets)
set_configvar(definition, 1)
if opt.links then
@@ -79,5 +79,5 @@ function configvar_check_csnippets(definition, snippets, opt)
add_cxflags(opt.cxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_ctypes.lua b/xmake/includes/check_ctypes.lua
index ad3d996d7..00c0ac952 100644
--- a/xmake/includes/check_ctypes.lua
+++ b/xmake/includes/check_ctypes.lua
@@ -31,7 +31,7 @@
--
function check_ctypes(definition, types, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_ctypes(types)
add_defines(definition)
if opt.languages then
@@ -44,7 +44,7 @@ function check_ctypes(definition, types, opt)
add_cxflags(opt.cxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check c types and add macro definition to the configuration types
@@ -56,7 +56,7 @@ end
--
function configvar_check_ctypes(definition, types, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_ctypes(types)
set_configvar(definition, 1)
if opt.languages then
@@ -69,5 +69,5 @@ function configvar_check_ctypes(definition, types, opt)
add_cxflags(opt.cxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_cxxfuncs.lua b/xmake/includes/check_cxxfuncs.lua
index 3d95ee589..5f861c5b8 100644
--- a/xmake/includes/check_cxxfuncs.lua
+++ b/xmake/includes/check_cxxfuncs.lua
@@ -37,7 +37,7 @@
--
function check_cxxfuncs(definition, funcs, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cxxfuncs(funcs)
add_defines(definition)
if opt.links then
@@ -56,7 +56,7 @@ function check_cxxfuncs(definition, funcs, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check c++ funcs and add macro definition to the configuration files
@@ -68,7 +68,7 @@ end
--
function configvar_check_cxxfuncs(definition, funcs, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cxxfuncs(funcs)
set_configvar(definition, 1)
if opt.links then
@@ -87,5 +87,5 @@ function configvar_check_cxxfuncs(definition, funcs, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_cxxincludes.lua b/xmake/includes/check_cxxincludes.lua
index 3db806a09..e2e6627b6 100644
--- a/xmake/includes/check_cxxincludes.lua
+++ b/xmake/includes/check_cxxincludes.lua
@@ -29,12 +29,13 @@
-- check_cxxincludes("HAS_STRING_H", "string.h")
-- check_cxxincludes("HAS_STRING_AND_STDIO_H", {"string.h", "stdio.h"})
--
-function check_cxxincludes(definition, includes)
- option(definition)
+function check_cxxincludes(definition, includes, opt)
+ opt = opt or {}
+ option(opt.name or definition)
add_cxxincludes(includes)
add_defines(definition)
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check include c++ files and add macro definition to the configuration files
@@ -44,10 +45,11 @@ end
-- configvar_check_cxxincludes("HAS_STRING_H", "string.h")
-- configvar_check_cxxincludes("HAS_STRING_AND_STDIO_H", {"string.h", "stdio.h"})
--
-function configvar_check_cxxincludes(definition, includes)
- option(definition)
+function configvar_check_cxxincludes(definition, includes, opt)
+ opt = opt or {}
+ option(opt.name or definition)
add_cxxincludes(includes)
set_configvar(definition, 1)
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_cxxsnippets.lua b/xmake/includes/check_cxxsnippets.lua
index 86d8467a0..65b833276 100644
--- a/xmake/includes/check_cxxsnippets.lua
+++ b/xmake/includes/check_cxxsnippets.lua
@@ -30,7 +30,7 @@
--
function check_cxxsnippets(definition, snippets, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cxxsnippets(definition, snippets)
add_defines(definition)
if opt.links then
@@ -49,7 +49,7 @@ function check_cxxsnippets(definition, snippets, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check c++ snippets and add macro definition to the configuration snippets
@@ -60,7 +60,7 @@ end
--
function configvar_check_cxxsnippets(definition, snippets, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cxxsnippets(definition, snippets)
set_configvar(definition, 1)
if opt.links then
@@ -79,5 +79,5 @@ function configvar_check_cxxsnippets(definition, snippets, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_cxxtypes.lua b/xmake/includes/check_cxxtypes.lua
index f6f89ea17..78e0ced37 100644
--- a/xmake/includes/check_cxxtypes.lua
+++ b/xmake/includes/check_cxxtypes.lua
@@ -31,7 +31,7 @@
--
function check_cxxtypes(definition, types, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cxxtypes(types)
add_defines(definition)
if opt.languages then
@@ -44,7 +44,7 @@ function check_cxxtypes(definition, types, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check c++ types and add macro definition to the configuration types
@@ -56,7 +56,7 @@ end
--
function configvar_check_cxxtypes(definition, types, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_cxxtypes(types)
set_configvar(definition, 1)
if opt.languages then
@@ -69,5 +69,5 @@ function configvar_check_cxxtypes(definition, types, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_features.lua b/xmake/includes/check_features.lua
index 295a7fc5e..56b3b9dcf 100644
--- a/xmake/includes/check_features.lua
+++ b/xmake/includes/check_features.lua
@@ -31,7 +31,7 @@
--
function check_features(definition, features, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_features(features)
add_defines(definition)
if opt.languages then
@@ -47,7 +47,7 @@ function check_features(definition, features, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check features and add macro definition to the configuration files
@@ -59,7 +59,7 @@ end
--
function configvar_check_features(definition, features, opt)
opt = opt or {}
- option(definition)
+ option(opt.name or definition)
add_features(features)
set_configvar(definition, 1)
if opt.languages then
@@ -75,5 +75,5 @@ function configvar_check_features(definition, features, opt)
add_cxxflags(opt.cxxflags)
end
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
diff --git a/xmake/includes/check_links.lua b/xmake/includes/check_links.lua
index 4b9ca49c2..11c97d749 100644
--- a/xmake/includes/check_links.lua
+++ b/xmake/includes/check_links.lua
@@ -30,11 +30,11 @@
-- check_links("HAS_PTHREAD", {"pthread", "m", "dl"})
--
function check_links(definition, links)
- option(definition)
+ option(opt.name or definition)
add_links(links)
add_defines(definition)
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end
-- check links and add macro definition to the configuration files
@@ -45,9 +45,9 @@ end
-- configvar_check_links("HAS_PTHREAD", {"pthread", "m", "dl"})
--
function configvar_check_links(definition, links)
- option(definition)
+ option(opt.name or definition)
add_links(links)
set_configvar(definition, 1)
option_end()
- add_options(definition)
+ add_options(opt.name or definition)
end