Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom vc build tools #5823

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

star-hengxing
Copy link
Contributor

if file then
local variables = {}
for line in file:gmatch("[^\r\n]+") do
local key, value = line:match("set%s+(.-)=(.*)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥不走运行捕获 envs,至少稳定可靠。

local outdata = try {function () return os.iorun(genvcvars_bat) end}

直接语法解析 set,不太稳吧。如果 set 是在 if 分支里呢,怎么判断取到的当前有效值

local file = io.readfile(opt.bat)
if file then
local variables = {}
for line in file:gmatch("[^\r\n]+") do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

file:lines()

VCToolsInstallDir = VCToolsInstallDirs[1]
end

local WindowsSDKDir = path.join(vs_build_tools, "Windows Kits/10")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没用到的代码 暂时去掉

@@ -43,6 +43,8 @@ platform("windows")
, " e.g. --vs_sdkver=10.0.15063.0" }
, {nil, "vs_runtime", "kv", nil, "The Runtime library of Visual Studio (deprecated, please use --runtimes)"
, values = {"MT", "MTd", "MD", "MDd"} }
, {nil, "vc_bat", "kv", nil, "The BuildTools bat file"
, " e.g. --vc_bat=C:/BuildTools/devcmd.bat" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 vs_devcmd 。。统一用 vs_ 前缀

function load_custom_vcenv(opt)
opt = opt or {}

if opt.bat and os.isfile(opt.bat) then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成 opt.devcmd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants