Skip to content

Commit

Permalink
update for windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunrisepeak committed Dec 17, 2024
1 parent 269f536 commit 2100f3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkgs/c/cpp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ package = {

xpm = {
windows = {
deps = {"msvc"},
deps = {"msvc@2022"},
["latest"] = { ref = "msvc" },
["msvc"] = {},
},
Expand All @@ -38,7 +38,7 @@ local pkginfo = runtime.get_pkginfo()

function installed()
if pkginfo.version == "msvc" then
return toolchain.load("msvc"):check()
return toolchain.load("msvc"):check() == "2022"
elseif pkginfo.version == "gnu" then
local output = os.iorun("gcc --version")
return string.find(output:trim(), "gcc", 1, true) ~= nil
Expand Down
8 changes: 6 additions & 2 deletions pkgs/m/msvc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,21 @@ package = {
keywords = { "msvc", "c++", "c" },

xpm = {
deps = { "vs-buildtools@2022" },
windows = {
deps = { "vs-buildtools@2022" },
["latest"] = { ref = "2022" },
["2022"] = { } -- v143
},
}
}

import("core.tool.toolchain")

-- https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2022
local msvc_component = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64"

function installed()
return toolchain.load("msvc"):check()
return toolchain.load("msvc"):check() == "2022"
end

function install()
Expand All @@ -36,6 +38,7 @@ function install()
-- " --norestart " ..
" --wait " -- ..
)
return true
end

function uninstall()
Expand All @@ -45,4 +48,5 @@ function uninstall()
" --passive " ..
" --wait "
)
return true
end

0 comments on commit 2100f3a

Please sign in to comment.