From a9590e436e0054e2ee9b952f3d0f1f2310c6f002 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Sun, 9 Jan 2022 23:07:48 +0800 Subject: Improve cmake_build, supports the specified config and target --- xmake/modules/package/tools/cmake.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index f49cedf0b..4e2662604 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -593,7 +593,16 @@ end -- do build for cmake/build function _build_for_cmakebuild(package, configs, opt) local cmake = assert(find_tool("cmake"), "cmake not found!") - os.vrunv(cmake.program, {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)}) + local argv = {"--build", os.curdir()} + if opt.config then + table.insert(argv, "--config") + table.insert(argv, opt.config) + end + if opt.target then + table.insert(argv, "--target") + table.insert(argv, opt.target) + end + os.vrunv(cmake.program, argv, {envs = opt.envs or buildenvs(package)}) end -- do install for msvc @@ -662,7 +671,12 @@ end function _install_for_cmakebuild(package, configs, opt) opt = opt or {} local cmake = assert(find_tool("cmake"), "cmake not found!") - os.vrunv(cmake.program, {"--build", os.curdir()}, {envs = opt.envs or buildenvs(package)}) + local argv = {"--build", os.curdir()} + if opt.config then + table.insert(argv, "--config") + table.insert(argv, opt.config) + end + os.vrunv(cmake.program, argv, {envs = opt.envs or buildenvs(package)}) os.vrunv(cmake.program, {"--install", os.curdir()}) end -- cgit v1.3.1 From cdebf2062b41239f4146d32ebd9464cee7921cee Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 11 Jan 2022 09:06:00 +0800 Subject: Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 952094f40..ef0397b26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * [#1923](https://github.com/xmake-io/xmake/issues/1923): Improve to build linux driver, support set custom linux-headers path * [#1962](https://github.com/xmake-io/xmake/issues/1962): Improve armclang toolchain to support to build asm +* [#1959](https://github.com/xmake-io/xmake/pull/1959): Improve vstudio project generator ### Bugs fixed @@ -1193,6 +1194,7 @@ * [#1923](https://github.com/xmake-io/xmake/issues/1923): 改进构建 linux 驱动,支持设置自定义 linux-headers 路径 * [#1962](https://github.com/xmake-io/xmake/issues/1962): 改进 armclang 工具链去支持构建 asm +* [#1959](https://github.com/xmake-io/xmake/pull/1959): 改进 vstudio 工程生成器 ### Bugs 修复 -- cgit v1.3.1 From 5cf6e9dc9132d6eda0b6018e3fa42bc9e1c39abf Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 12 Jan 2022 00:30:58 +0800 Subject: add default option description --- xmake/core/project/option.lua | 9 +++++++-- xmake/core/project/project.lua | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/xmake/core/project/option.lua b/xmake/core/project/option.lua index 0364b3b47..40fd43f1a 100644 --- a/xmake/core/project/option.lua +++ b/xmake/core/project/option.lua @@ -414,13 +414,13 @@ function _instance:add(name, ...) self:_invalidate() end --- remove the value to the option info +-- remove the value to the option info (deprecated) function _instance:del(name, ...) self._INFO:apival_del(name, ...) self:_invalidate() end --- remove the value to the option info (deprecated) +-- remove the value to the option info function _instance:remove(name, ...) self._INFO:apival_remove(name, ...) self:_invalidate() @@ -454,6 +454,11 @@ function _instance:name() return self._NAME end +-- get the option description +function _instance:description() + return self:get("description") or ("The " .. self:name() .. " option") +end + -- get the cache key function _instance:cachekey() return string.format("%s_%d", tostring(self), self._CACHEID) diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 3aee363a3..cd5171599 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -1161,15 +1161,15 @@ function project.menu() -- append it local longname = name - local descriptions = opt:get("description") - if descriptions then + local description = opt:description() + if description then -- define menu option - local menu_options = {nil, longname, "kv", default, descriptions} + local menu_options = {nil, longname, "kv", default, description} -- handle set_description("xx", "xx") - if type(descriptions) == "table" then - for i, description in ipairs(descriptions) do + if type(description) == "table" then + for i, description in ipairs(description) do menu_options[4 + i] = description end end -- cgit v1.3.1 From bfe709359acac06a8d33cd2ef2c3be34541d388f Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 12 Jan 2022 00:31:22 +0800 Subject: add default option description to menuconf --- xmake/actions/config/menuconf.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/actions/config/menuconf.lua b/xmake/actions/config/menuconf.lua index 8ca87d918..94ec2782e 100644 --- a/xmake/actions/config/menuconf.lua +++ b/xmake/actions/config/menuconf.lua @@ -323,7 +323,7 @@ function app:_project_configs(cache) local kind = (type(default) == "string") and "string" or "boolean" -- get description - local description = opt:get("description") + local description = opt:description() -- get source info local sourceinfo = (opt:get("__sourceinfo_description") or {})[type(description) == "table" and description[1] or description] -- cgit v1.3.1 From ff09778ea6494e39e3375e83fe5673cc7735b25e Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 11 Jan 2022 21:11:38 +0800 Subject: Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef0397b26..1b10e4f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ * [#1923](https://github.com/xmake-io/xmake/issues/1923): Improve to build linux driver, support set custom linux-headers path * [#1962](https://github.com/xmake-io/xmake/issues/1962): Improve armclang toolchain to support to build asm * [#1959](https://github.com/xmake-io/xmake/pull/1959): Improve vstudio project generator +* [#1969](https://github.com/xmake-io/xmake/issues/1969): Add default option description ### Bugs fixed @@ -1195,6 +1196,7 @@ * [#1923](https://github.com/xmake-io/xmake/issues/1923): 改进构建 linux 驱动,支持设置自定义 linux-headers 路径 * [#1962](https://github.com/xmake-io/xmake/issues/1962): 改进 armclang 工具链去支持构建 asm * [#1959](https://github.com/xmake-io/xmake/pull/1959): 改进 vstudio 工程生成器 +* [#1969](https://github.com/xmake-io/xmake/issues/1969): 添加默认的 option 描述 ### Bugs 修复 -- cgit v1.3.1 From 11b52516ece319713d9d0e560234de87fa59df51 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 12 Jan 2022 00:51:32 +0800 Subject: improve vcpkg.find_package --- xmake/modules/package/manager/vcpkg/find_package.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua index e61e56c29..b15844ede 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -79,10 +79,11 @@ function _find_package(vcpkgdir, name, opt) arch = configurations.arch(arch) -- get the vcpkg info directories - local infodirs = { - path.join(opt.installdir, "vcpkg_installed", "vcpkg", "info"), - path.join(vcpkgdir, "installed", "vcpkg", "info") - } + local infodirs = {} + if opt.installdir then + table.join2(infodirs, path.join(opt.installdir, "vcpkg_installed", "vcpkg", "info")) + end + table.join2(infodirs, path.join(vcpkgdir, "installed", "vcpkg", "info")) -- find the package info file, e.g. zlib_1.2.11-3_x86-windows[-static].list local triplet = arch .. "-" .. plat -- cgit v1.3.1 From 9f9ef89aa3bbc51e364908469d5aabd351aa1c7c Mon Sep 17 00:00:00 2001 From: Chen Yufei Date: Wed, 12 Jan 2022 17:49:53 +0800 Subject: autoconf: run autoreconf for configure.in configure.in is the old name for autoconf input. --- xmake/modules/package/tools/autoconf.lua | 6 ++++-- xmake/modules/private/action/trybuild/autotools.lua | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 12b94d64f..ed5157f8a 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -325,8 +325,10 @@ function configure(package, configs, opt) if not os.isfile("configure") then if os.isfile("autogen.sh") then os.vrunv("sh", {"./autogen.sh"}, {envs = autogen_envs(package, opt)}) - elseif os.isfile("configure.ac") then - os.vrunv("sh", {"autoreconf", "--install", "--symlink"}, {envs = autogen_envs(package, opt)}) + elseif os.isfile("configure.ac") or os.isfile("configure.in") then + local autoreconf = find_tool("autoreconf") + assert(autoreconf, "autoreconf not found!") + os.vrunv("sh", {autoreconf.program, "--install", "--symlink"}, {envs = autogen_envs(package, opt)}) end end diff --git a/xmake/modules/private/action/trybuild/autotools.lua b/xmake/modules/private/action/trybuild/autotools.lua index 1d4090522..fe484c98e 100644 --- a/xmake/modules/private/action/trybuild/autotools.lua +++ b/xmake/modules/private/action/trybuild/autotools.lua @@ -221,8 +221,10 @@ function build() if not os.isfile("configure") then if os.isfile("autogen.sh") then os.vexecv("sh", {"./autogen.sh"}) - elseif os.isfile("configure.ac") then - os.vexecv("sh", {"autoreconf", "--install", "--symlink"}) + elseif os.isfile("configure.ac") or os.isfile("configure.in") then + local autoreconf = find_tool("autoreconf") + assert(autoreconf, "autoreconf not found!") + os.vexecv("sh", {autoreconf.program, "--install", "--symlink"}) end end -- cgit v1.3.1