summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-20 23:18:02 +0800
committerruki <[email protected]>2021-12-20 23:18:02 +0800
commita1abfda3ca119979f541876355471b026abcc3f9 (patch)
tree566aa88ca52154eebc00309ebc4170294c208cee /xmake/modules
parent39349f1a4fbf510d434c01952fe1f8f7e7505259 (diff)
find package stub for vcpkg manifest mode
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua40
1 files changed, 25 insertions, 15 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua
index e84833958..726eceea7 100644
--- a/xmake/modules/package/manager/vcpkg/find_package.lua
+++ b/xmake/modules/package/manager/vcpkg/find_package.lua
@@ -27,21 +27,8 @@ import("core.project.target")
import("detect.sdks.find_vcpkgdir")
import("package.manager.vcpkg.configurations")
--- find package from the vcpkg package manager
---
--- @param name the package name, e.g. zlib, pcre
--- @param opt the options, e.g. {verbose = true)
---
-function main(name, opt)
-
- -- attempt to find vcpkg directory
- 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!")
- end
- return
- end
+-- find it for classic mode
+function _find_package_for_classic(vcpkgdir, name, opt)
-- fix name, e.g. ffmpeg[x264] as ffmpeg
-- @see https://github.com/xmake-io/xmake/issues/925
@@ -137,3 +124,26 @@ function main(name, opt)
return result
end
+-- find it for manifest mode
+function _find_package_for_manifest(vcpkgdir, name, opt)
+end
+
+-- find package from the vcpkg package manager
+--
+-- @param name the package name, e.g. zlib, pcre
+-- @param opt the options, e.g. {verbose = true)
+--
+function main(name, opt)
+
+ -- attempt to find vcpkg directory
+ 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!")
+ end
+ return
+ end
+
+ -- do find
+ return _find_package_for_manifest(vcpkgdir, name, opt) or _find_package_for_classic(vcpkgdir, name, opt)
+end