diff options
| author | ruki <[email protected]> | 2019-03-28 23:16:33 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-03-28 13:39:21 +0800 |
| commit | 880e002552b6dfe69fe3e5d105275f0aabf82195 (patch) | |
| tree | bba9fa725d522fd8d627b181f1401a1531b81db7 | |
| parent | ca1668be5f36ddbb082ea52d77585645b9739f48 (diff) | |
fix configurations for conan
| -rw-r--r-- | xmake/actions/require/impl/action/install.lua | 4 | ||||
| -rw-r--r-- | xmake/core/package/package.lua | 10 | ||||
| -rw-r--r-- | xmake/modules/package/manager/conan/install_package.lua | 13 |
3 files changed, 25 insertions, 2 deletions
diff --git a/xmake/actions/require/impl/action/install.lua b/xmake/actions/require/impl/action/install.lua index 202b4b957..2f4efed87 100644 --- a/xmake/actions/require/impl/action/install.lua +++ b/xmake/actions/require/impl/action/install.lua @@ -218,7 +218,7 @@ function main(package) -- trace printf("\r" .. _emptychars()) - cprint("\r${yellow} => ${clear}install %s-%s .. ${color.success}${text.success}", package:name(), package:version_str()) + cprint("\r${yellow} => ${clear}install %s %s .. ${color.success}${text.success}", package:name(), package:version_str() or "") end, catch @@ -232,7 +232,7 @@ function main(package) -- trace printf("\r" .. _emptychars()) - cprint("\r${yellow} => ${clear}install %s-%s .. ${color.failure}${text.failure}", package:name(), package:version_str()) + cprint("\r${yellow} => ${clear}install %s %s .. ${color.failure}${text.failure}", package:name(), package:version_str() or "") -- leave the package environments package:envs_leave() diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 92e60489d..a9d534672 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -967,6 +967,16 @@ function package.load_from_system(packagename) instance._isSys = true instance._is3rd = is3rd + -- add configurations for the 3rd package + if is3rd then + local install_package = sandbox_module.import("package.manager." .. packagename:split("::")[1]:lower() .. ".install_package", {try = true, anonymous = true}) + if install_package and install_package.configurations then + for name, conf in pairs(install_package.configurations()) do + instance:add("configs", name, conf) + end + end + end + -- save instance to the cache package._PACKAGES[packagename] = instance diff --git a/xmake/modules/package/manager/conan/install_package.lua b/xmake/modules/package/manager/conan/install_package.lua index 4fdb66ffa..740c00558 100644 --- a/xmake/modules/package/manager/conan/install_package.lua +++ b/xmake/modules/package/manager/conan/install_package.lua @@ -58,6 +58,19 @@ xmake ]]):format(name, table.concat(options, "\n"), table.concat(imports, "\n"), table.concat(build_requires, "\n"))) end +-- get configurations +function configurations(package) + return + { + build = {description = "use it to choose if you want to build from sources.", default = "all", values = {"all", "never", "missing", "outdated"}}, + remote = {description = "Set the conan remote server."}, + options = {description = "Set the options values, e.g. OpenSSL:shared=True"}, + imports = {description = "Set the imports for conan."}, + settings = {description = "Set the build settings for conan."}, + build_requires = {description = "Set the build requires for conan."} + } +end + -- install package -- -- @param name the package name, e.g. conan::OpenSSL/1.0.2n@conan/stable |
