diff options
| author | ruki <[email protected]> | 2023-02-17 00:45:02 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-02-17 00:45:02 +0800 |
| commit | e4716ca9e43b1fc5b7eedbdef96f88b361153da6 (patch) | |
| tree | 9877635d8ba3e3c7a06b06d5356c924e06e8e633 | |
| parent | 0eccc6e924eeb8deb66191e23298fd168ee2e833 (diff) | |
improve to find vcpkg package tips
| -rw-r--r-- | xmake/modules/package/manager/find_package.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 9 |
2 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/package/manager/find_package.lua b/xmake/modules/package/manager/find_package.lua index 7d82043b2..acf560a40 100644 --- a/xmake/modules/package/manager/find_package.lua +++ b/xmake/modules/package/manager/find_package.lua @@ -77,6 +77,7 @@ function _find_package_with_builtin_rule(package_name, opt) -- find package from the given package manager local result = nil local found_manager_name = nil + opt = table.join({try = true}, opt) for _, manager_name in ipairs(managers) do dprint("finding %s from %s ..", package_name, manager_name) result = import("package.manager." .. manager_name .. ".find_package", {anonymous = true})(package_name, opt) diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua index 2853c87ee..c3e18f0c4 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -178,12 +178,13 @@ end -- @param opt the options, e.g. {verbose = true) -- function main(name, opt) - - -- attempt to find vcpkg directory + opt = opt or {} local vcpkgdir = find_vcpkgdir() if not vcpkgdir then - if option.get("diagnosis") then - cprint("${color.warning}checkinfo: ${clear dim}vcpkg root directory not found, maybe you need set $VCPKG_ROOT!") + + -- we need show warning if we do not try finding package and vcpkg root directory not found. + if not opt.try then + wprint("vcpkg root directory not found, maybe you need set $VCPKG_ROOT!") end return end |
