summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-04-15 11:58:21 +0800
committerruki <[email protected]>2016-04-15 11:58:21 +0800
commita8915ae9e7eb10d30ff1cd59bb1dc719e23d0155 (patch)
treeafc6fae08e4ec77eb5473aa4abc4885c76215344
parent8783f5a604a928f414059b77d2bcc4eb6ef10803 (diff)
fix bug for global
-rw-r--r--xmake/core/base/utils.lua12
-rw-r--r--xmake/core/project/global.lua5
-rw-r--r--xmake/platforms/macosx/checker.lua16
3 files changed, 15 insertions, 18 deletions
diff --git a/xmake/core/base/utils.lua b/xmake/core/base/utils.lua
index bfb5469af..5d69bdcd0 100644
--- a/xmake/core/base/utils.lua
+++ b/xmake/core/base/utils.lua
@@ -39,11 +39,8 @@ end
-- the verbose function
function utils.verbose(msg, ...)
- if option.get("verbose") then
+ if option.get("verbose") and msg ~= nil then
- -- check
- assert(msg)
-
-- trace
print(string.format(msg, ...))
end
@@ -52,11 +49,10 @@ end
-- the error function
function utils.error(msg, ...)
- -- check
- assert(msg)
-
-- trace
- print("error: " .. string.format(msg, ...))
+ if msg ~= nil then
+ print("error: " .. string.format(msg, ...))
+ end
end
-- the warning function
diff --git a/xmake/core/project/global.lua b/xmake/core/project/global.lua
index d695f7bef..36d075586 100644
--- a/xmake/core/project/global.lua
+++ b/xmake/core/project/global.lua
@@ -68,12 +68,9 @@ end
-- get all options
function global.options()
- -- check
- assert(global._CONFIGS)
-
-- remove values with "auto" and private item
local configs = {}
- for name, value in pairs(global._CONFIGS) do
+ for name, value in pairs(table.wrap(global._CONFIGS)) do
if not name:find("^_%u+") and (type(value) ~= "string" or value ~= "auto") then
configs[name] = value
end
diff --git a/xmake/platforms/macosx/checker.lua b/xmake/platforms/macosx/checker.lua
index 97e8e981f..afba70fb6 100644
--- a/xmake/platforms/macosx/checker.lua
+++ b/xmake/platforms/macosx/checker.lua
@@ -71,9 +71,11 @@ function _check_xcode(config)
print("checking for the Xcode application directory ... %s", xcode_dir)
else
-- failed
- raise("checking for the Xcode application directory ... no\n" ..
- " - xmake config --xcode_dir=xxx\n" ..
- "or - xmake global --xcode_dir=xxx")
+ print("checking for the Xcode application directory ... no")
+ print("please run:")
+ print(" - xmake config --xcode_dir=xxx")
+ print("or - xmake global --xcode_dir=xxx")
+ raise()
end
end
end
@@ -106,9 +108,11 @@ function _check_xcode_sdkver(config)
print("checking for the Xcode SDK version for %s ... %s", config.get("plat"), xcode_sdkver)
else
-- failed
- raise("checking for the Xcode SDK version for %s ... no\n" ..
- " - xmake config --xcode_sdkver=xxx" ..
- "or - xmake global --xcode_sdkver=xxx", config.get("plat"))
+ print("checking for the Xcode SDK version for %s ... no", config.get("plat"))
+ print("please run:")
+ print(" - xmake config --xcode_sdkver=xxx")
+ print("or - xmake global --xcode_sdkver=xxx")
+ raise()
end
end
end