summaryrefslogtreecommitdiff
path: root/xmake/modules
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 /xmake/modules
parented0c0c5e0249aa966ea7061b30710abdd0b09d87 (diff)
parentedcbcd5127a9f3b7bbe93d34aa1921856db9a8fb (diff)
Merge branch 'master' of https://github.com/xmake-io/xmake into modnamefix
Diffstat (limited to 'xmake/modules')
-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
4 files changed, 29 insertions, 10 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
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