summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-03-26 21:59:40 +0800
committerruki <[email protected]>2017-03-26 21:59:40 +0800
commit9246c2b152821cc708f886e98b11b904294a74ce (patch)
treec2f6b2a3a128794962cb825604809ad182625071
parent4023b18df929afe8a2b65f83090ba163f3381682 (diff)
fix error tips
-rw-r--r--CHANGELOG.md8
-rw-r--r--core/xmake.lua3
-rw-r--r--xmake/core/base/option.lua19
3 files changed, 21 insertions, 9 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index af4c7d95e..493d0c8b9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
## master (unreleased)
+## Bugs fixed
+
+* Fix error tips for checking xmake min version
+
## v2.1.2
### New features
@@ -222,6 +226,10 @@
## master (开发中)
+### Bugs修复
+
+* 修复版本检测的错误提示信息
+
## v2.1.2
### 新特性
diff --git a/core/xmake.lua b/core/xmake.lua
index 849b1987f..d95f8dc64 100644
--- a/core/xmake.lua
+++ b/core/xmake.lua
@@ -4,6 +4,9 @@ set_project("xmake")
-- version
set_version("2.1.3")
+-- set xmake min version
+set_xmakever("2.1.2")
+
-- set warning all as error
set_warnings("all", "error")
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index 06543c066..0bcd6f4b4 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -91,10 +91,9 @@ function option._context()
-- the contexts
local contexts = option._CONTEXTS
- assert(contexts)
-
- -- get it
- return contexts[#contexts]
+ if contexts then
+ return contexts[#contexts]
+ end
end
-- get longname
@@ -743,10 +742,9 @@ function option.get(name)
-- the options
local options = option.options()
- assert(options)
-
- -- get it
- return options[name] or option.default(name)
+ if options then
+ return options[name] or option.default(name)
+ end
end
-- set the given option for the current task
@@ -784,7 +782,10 @@ end
function option.options()
-- get it
- return option._context().options
+ local context = option._context()
+ if context then
+ return context.options
+ end
end
-- get all default options for the current or given task