summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-09-13 00:43:11 +0800
committerruki <[email protected]>2017-09-12 22:19:11 +0800
commit8931e2912379ab9aa1b585c365af9006dd500d97 (patch)
tree32fe9d545ab7d10bf7c160ff00a9350428c17c4c
parent71606410bdf3ca069f069f4f0f9c14f55a4721c5 (diff)
inherit option script to package
-rw-r--r--xmake/actions/require/list.lua4
-rw-r--r--xmake/core/package/package.lua2
-rw-r--r--xmake/core/project/project.lua10
3 files changed, 13 insertions, 3 deletions
diff --git a/xmake/actions/require/list.lua b/xmake/actions/require/list.lua
index 231b7629b..3964ff284 100644
--- a/xmake/actions/require/list.lua
+++ b/xmake/actions/require/list.lua
@@ -35,6 +35,8 @@ function _from(instance)
return ", ${green}" .. fetchfrom .. "${clear}"
elseif #instance:urls() > 0 then
return ", ${yellow}remote${clear}"
+ elseif instance:from("system") then
+ return ", ${red}missing${clear}"
else
return ""
end
@@ -44,7 +46,7 @@ end
function main()
-- list all requires
- print("Tha package dependencies:")
+ print("The package dependencies:")
-- get requires
local requires, requires_extra = project.requires()
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index 04a1fedb6..0f46f9505 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -291,7 +291,7 @@ function _instance:fetch()
-- fetch it from the system directories
if not fetchinfo then
local system = self:requireinfo().system
- if system == nil then -- enable by default
+ if system == nil then -- find system package by default
system = true
end
if system then
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua
index fda0fc5f9..9dddbe8f8 100644
--- a/xmake/core/project/project.lua
+++ b/xmake/core/project/project.lua
@@ -531,7 +531,15 @@ function project._load_options(disable_filter)
-- override values from the extra option
for name, value in pairs(table.wrap(require_extra.option)) do
- packageopt[name] = value
+ if type(value) == "function" then
+ local maps = {on_check = "check", before_check = "check_before", after_check = "check_after"}
+ local scriptname = maps[name]
+ if scriptname then
+ packageopt[scriptname] = interp:_script(value)
+ end
+ else
+ packageopt[name] = value
+ end
end
end