From ce7eccec1148a259ac8d73e098ceb1974deb1f5e Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 19 Dec 2022 22:46:41 +0800 Subject: fix xrepo export --- xmake/modules/private/xrepo/action/export.lua | 10 ++++++---- xmake/modules/private/xrepo/action/fetch.lua | 4 ++-- xmake/modules/private/xrepo/action/import.lua | 10 ++++++---- xmake/modules/private/xrepo/action/info.lua | 4 ++-- xmake/modules/private/xrepo/action/install.lua | 2 +- xmake/modules/private/xrepo/action/remove.lua | 4 ++-- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/xmake/modules/private/xrepo/action/export.lua b/xmake/modules/private/xrepo/action/export.lua index 89d34ed75..551d978a3 100644 --- a/xmake/modules/private/xrepo/action/export.lua +++ b/xmake/modules/private/xrepo/action/export.lua @@ -170,9 +170,9 @@ function _export_packages(packages) if mode == "debug" then extra.debug = true end - if kind == "shared" then + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then @@ -216,12 +216,14 @@ function _export_current_packages(packages) require_argv.packagedir = packagedir end local extra = {system = false} + local mode = option.get("mode") if mode == "debug" then extra.debug = true end - if kind == "shared" then + local kind = option.get("kind") + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then diff --git a/xmake/modules/private/xrepo/action/fetch.lua b/xmake/modules/private/xrepo/action/fetch.lua index 41a14527e..1b9071be5 100644 --- a/xmake/modules/private/xrepo/action/fetch.lua +++ b/xmake/modules/private/xrepo/action/fetch.lua @@ -188,9 +188,9 @@ function _fetch_packages(packages) if mode == "debug" then extra.debug = true end - if kind == "shared" then + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then diff --git a/xmake/modules/private/xrepo/action/import.lua b/xmake/modules/private/xrepo/action/import.lua index 6acb665f6..8c32e2c0f 100644 --- a/xmake/modules/private/xrepo/action/import.lua +++ b/xmake/modules/private/xrepo/action/import.lua @@ -129,9 +129,9 @@ function _import_packages(packages) if mode == "debug" then extra.debug = true end - if kind == "shared" then + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then @@ -173,12 +173,14 @@ function _import_current_packages(packages) require_argv.packagedir = packagedir end local extra = {system = false} + local mode = option.get("mode") if mode == "debug" then extra.debug = true end - if kind == "shared" then + local kind = option.get("kind") + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then diff --git a/xmake/modules/private/xrepo/action/info.lua b/xmake/modules/private/xrepo/action/info.lua index bc57716f3..3bc547b94 100644 --- a/xmake/modules/private/xrepo/action/info.lua +++ b/xmake/modules/private/xrepo/action/info.lua @@ -112,9 +112,9 @@ function _info_packages(packages) if mode == "debug" then extra.debug = true end - if kind == "shared" then + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then diff --git a/xmake/modules/private/xrepo/action/install.lua b/xmake/modules/private/xrepo/action/install.lua index 547d1326c..f650e5ff1 100644 --- a/xmake/modules/private/xrepo/action/install.lua +++ b/xmake/modules/private/xrepo/action/install.lua @@ -247,7 +247,7 @@ function _install_packages(packages) if mode == "debug" then extra.debug = true end - if option.get("kind") then + if kind then extra.configs = extra.configs or {} extra.configs.shared = kind == "shared" end diff --git a/xmake/modules/private/xrepo/action/remove.lua b/xmake/modules/private/xrepo/action/remove.lua index 7b61f9a96..1ccfa140e 100644 --- a/xmake/modules/private/xrepo/action/remove.lua +++ b/xmake/modules/private/xrepo/action/remove.lua @@ -162,9 +162,9 @@ function _remove_packages(packages) if mode == "debug" then extra.debug = true end - if kind == "shared" then + if kind then extra.configs = extra.configs or {} - extra.configs.shared = true + extra.configs.shared = kind == "shared" end local configs = option.get("configs") if configs then -- cgit v1.3.1