diff options
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 9 | ||||
| -rw-r--r-- | xmake/modules/package/tools/autoconf.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 18 | ||||
| -rw-r--r-- | xmake/modules/private/action/trybuild/autotools.lua | 6 |
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 |
