summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-11 00:38:25 +0800
committerruki <[email protected]>2018-09-10 21:50:36 +0800
commita4854beb9512f0fd868dd7bc5c00c4ca236a92f2 (patch)
tree36396d249f0d1fad9316b9378131ebb22013451c
parente4d6de3fa21809d29484eda04c33985b4b891adb (diff)
add get_config
-rw-r--r--CHANGELOG.md4
-rw-r--r--xmake/core/project/project.lua8
2 files changed, 9 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f1d95c56..c5e705757 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,7 +5,7 @@
### New features
* Support fasm assembler
-* Add `has_config` and `is_config` apis
+* Add `has_config`, `get_config` and `is_config` apis
* Add `$ xmake --try` to try building project using third-party buildsystem
* Add `set_enabled(false)` to disable target
@@ -485,7 +485,7 @@
### 新特性
* 新增fasm汇编器支持
-* 添加`has_config`和`is_config`接口去快速判断option和配置值
+* 添加`has_config`, `get_config`和`is_config`接口去快速判断option和配置值
* 添加`$ xmake --try`去尝试构建工程
* 添加`set_enabled(false)`去显示的禁用target
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index b60e5f79b..b2bc6deb0 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -108,6 +108,11 @@ function project._api_has_config(interp, ...)
return config.has(...)
end
+-- get config from the given name
+function project._api_get_config(interp, name)
+ return config.get(name)
+end
+
-- add module directories
function project._api_add_moduledirs(interp, ...)
sandbox_module.add_directories(...)
@@ -200,7 +205,8 @@ function project.interpreter()
, {"is_plat", project._api_is_plat }
, {"is_arch", project._api_is_arch }
, {"is_config", project._api_is_config }
- , {"has_config", project._api_has_config }
+ , {"get_config", project._api_get_config }
+ , {"has_config", project._api_has_config }
-- add_xxx
, {"add_moduledirs", project._api_add_moduledirs }
, {"add_plugindirs", project._api_add_plugindirs }