summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÂngelo Andrade Cirino <[email protected]>2022-01-14 09:15:19 -0300
committerÂngelo Andrade Cirino <[email protected]>2022-01-14 09:15:19 -0300
commit274244bf3530a77ab3c93309e5ea5bb5d29907ae (patch)
treec77ea18ad77df218272b0d63089e121e433e1457
parented0c0c5e0249aa966ea7061b30710abdd0b09d87 (diff)
parentedcbcd5127a9f3b7bbe93d34aa1921856db9a8fb (diff)
Merge branch 'master' of https://github.com/xmake-io/xmake into modnamefix
-rw-r--r--CHANGELOG.md4
-rw-r--r--xmake/actions/config/menuconf.lua2
-rw-r--r--xmake/core/project/option.lua9
-rw-r--r--xmake/core/project/project.lua10
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua9
-rw-r--r--xmake/modules/package/tools/autoconf.lua6
-rw-r--r--xmake/modules/package/tools/cmake.lua18
-rw-r--r--xmake/modules/private/action/trybuild/autotools.lua6
8 files changed, 46 insertions, 18 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 952094f40..1b10e4f0c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,8 @@
* [#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
@@ -1193,6 +1195,8 @@
* [#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 修复
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]
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
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
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/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
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