diff options
| author | ruki <[email protected]> | 2021-12-20 22:59:51 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-12-20 22:59:51 +0800 |
| commit | 4b139c33e84d6f2261bea3ec07ec889b44cebd96 (patch) | |
| tree | 8889ca853f71429464e6222e25a7002eeef1daa6 /xmake/modules/package | |
| parent | fde9f472906c2b7061afa5afed4128817ffd15c1 (diff) | |
add vcpkg tests for manifest
Diffstat (limited to 'xmake/modules/package')
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/install_package.lua | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/xmake/modules/package/manager/vcpkg/install_package.lua b/xmake/modules/package/manager/vcpkg/install_package.lua index eaf28710e..071eec03b 100644 --- a/xmake/modules/package/manager/vcpkg/install_package.lua +++ b/xmake/modules/package/manager/vcpkg/install_package.lua @@ -22,20 +22,13 @@ import("core.base.option") import("lib.detect.find_tool") --- install package --- --- @param name the package name, e.g. pcre2, pcre2/libpcre2-8 --- @param opt the options, e.g. {verbose = true} --- --- @return true or false --- -function main(name, opt) +-- need manifest mode? +function _need_manifest(opt) +-- print("_need_manifest", opt) +end - -- attempt to find vcpkg - local vcpkg = find_tool("vcpkg") - if not vcpkg then - raise("vcpkg not found!") - end +-- install for classic mode +function _install_for_classic(vcpkg, name, opt) -- get arch, plat and mode local arch = opt.arch @@ -81,5 +74,28 @@ function main(name, opt) end -- install package - os.vrunv(vcpkg.program, argv) + os.vrunv(vcpkg, argv) +end + +-- install package +-- +-- @param name the package name, e.g. pcre2, pcre2/libpcre2-8 +-- @param opt the options, e.g. {verbose = true} +-- +-- @return true or false +-- +function main(name, opt) + + -- attempt to find vcpkg + local vcpkg = find_tool("vcpkg") + if not vcpkg then + raise("vcpkg not found!") + end + + -- do install + if _need_manifest(opt) then + _install_for_manifest(vcpkg.program, name, opt) + else + _install_for_classic(vcpkg.program, name, opt) + end end |
