diff options
| -rw-r--r-- | xmake/modules/package/manager/vcpkg/find_package.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua index 045adf050..531137b29 100644 --- a/xmake/modules/package/manager/vcpkg/find_package.lua +++ b/xmake/modules/package/manager/vcpkg/find_package.lua @@ -136,6 +136,13 @@ function _find_package(vcpkg, vcpkgdir, name, opt) -- get configs local configs = opt.configs or {} + -- extract required features before stripping, e.g. curl[openssl,mbedtls] -> {"openssl", "mbedtls"} + local required_features + local features_str = name:match("%[(.-)%]") + if features_str then + required_features = features_str:split(",", {plain = true}) + end + -- fix name, e.g. ffmpeg[x264] as ffmpeg -- @see https://github.com/xmake-io/xmake/issues/925 name = name:gsub("%[.-%]", "") @@ -161,6 +168,17 @@ function _find_package(vcpkg, vcpkgdir, name, opt) return end + -- check that required features are installed + -- e.g. curl[mbedtls] should have curl_*_triplet_mbedtls.list in info directory + if required_features then + for _, feature in ipairs(required_features) do + local feature_infofile = find_file(format("%s_*_%s_%s.list", name, triplet, feature), infodirs) + if not feature_infofile then + return + end + end + end + -- find dependency package local result = nil local _, dependinfo = try { function () return os.iorunv(vcpkg, {"depend-info", name, "--sort=reverse", "--triplet=" .. triplet}) end } |
