diff options
| author | ruki <[email protected]> | 2021-07-17 10:46:04 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-07-17 10:46:04 +0800 |
| commit | cc3a1942dae6444f192fc14a9bf32bd07120fff4 (patch) | |
| tree | 2a6595085676fda52ddeeba63d6d63ef247787f7 /xmake/modules/private/action/require/impl/package.lua | |
| parent | 292311dbc3a161a4ab85758e069131ac83227d47 (diff) | |
improve to select artifacts
Diffstat (limited to 'xmake/modules/private/action/require/impl/package.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/package.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua index 3eb47d11f..79a4647d3 100644 --- a/xmake/modules/private/action/require/impl/package.lua +++ b/xmake/modules/private/action/require/impl/package.lua @@ -555,7 +555,13 @@ function _select_artifacts_for_msvc(package, artifacts_manifest) table.insert(artifacts_infos, artifacts_info) end end - table.sort(artifacts_infos, function (a, b) return semver.compare(a.toolset, b.toolset) > 0 end) + table.sort(artifacts_infos, function (a, b) + if a.toolset and b.toolset then + return semver.compare(a.toolset, b.toolset) > 0 + else + return false + end + end) return artifacts_infos[1] else local buildid = package:plat() .. "-" .. package:arch() .. "-" .. msvc_version .. "-" .. package:buildhash() |
