From 3771914111417782318c99447565a577c9e84c5a Mon Sep 17 00:00:00 2001 From: 白喵 <478688389@qq.com> Date: Sat, 29 Jun 2024 18:03:51 +0800 Subject: fix find vc6 --- xmake/modules/detect/sdks/find_vstudio.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 31180e13b..b27813396 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -342,11 +342,18 @@ function _find_vstudio(opt) table.insert(paths, path.join(logical_drive, "Program Files", "Microsoft Visual Studio", vsvers[version], "*", "VC", "Auxiliary", "Build")) table.insert(paths, path.join(logical_drive, "Program Files", "Microsoft Visual Studio " .. version, "VC")) if version == "6.0" then - table.insert(paths, path.join(logical_drive, "Program Files", "Microsoft Visual Studio", "VC98", "Bin")) + table.insert(paths, path.join(logical_drive, "Program Files (x86)", "Microsoft Visual Studio", "VC98", "Bin")) end end vcvarsall = find_file("vcvarsall.bat", paths) or find_file("vcvars32.bat", paths) end + if not vcvarsall and version == "6.0" then + local paths = { + "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\DevStudio\\6.0\\Products\\Microsoft Visual C++;ProductDir)\\Bin", + "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++;ProductDir)\\Bin" + } + vcvarsall = find_file("vcvars32.bat", paths) + end if not vcvarsall then local paths = { format("$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;%s)\\Common7\\Tools", version), -- cgit v1.3.1 From cb8554de6bc050bc325c0eb3e146409d5aae819d Mon Sep 17 00:00:00 2001 From: 白喵 <478688389@qq.com> Date: Sat, 29 Jun 2024 19:16:36 +0800 Subject: add path --- xmake/modules/detect/sdks/find_vstudio.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index b27813396..cae457d68 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -342,6 +342,7 @@ function _find_vstudio(opt) table.insert(paths, path.join(logical_drive, "Program Files", "Microsoft Visual Studio", vsvers[version], "*", "VC", "Auxiliary", "Build")) table.insert(paths, path.join(logical_drive, "Program Files", "Microsoft Visual Studio " .. version, "VC")) if version == "6.0" then + table.insert(paths, path.join(logical_drive, "Program Files", "Microsoft Visual Studio", "VC98", "Bin")) table.insert(paths, path.join(logical_drive, "Program Files (x86)", "Microsoft Visual Studio", "VC98", "Bin")) end end -- cgit v1.3.1 From db8a5fb7cd8f97e46501fcce938f5c6fc7609029 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 29 Jun 2024 20:00:25 +0800 Subject: Update find_vstudio.lua --- xmake/modules/detect/sdks/find_vstudio.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index cae457d68..a6b7f471e 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -317,7 +317,11 @@ function _find_vstudio(opt) if vswhere_VCAuxiliaryBuildDir and os.isdir(vswhere_VCAuxiliaryBuildDir) then table.insert(paths, 1, vswhere_VCAuxiliaryBuildDir) end - + if version == "6.0" and os.arch() == "x64" then + table.insert(paths, "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\DevStudio\\6.0\\Products\\Microsoft Visual C++;ProductDir)\\Bin") + table.insert(paths, "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++;ProductDir)\\Bin") + end + -- find vcvarsall.bat, vcvars32.bat for vs7.1 local vcvarsall = find_file("vcvarsall.bat", paths) or find_file("vcvars32.bat", paths) if not vcvarsall then @@ -348,13 +352,6 @@ function _find_vstudio(opt) end vcvarsall = find_file("vcvarsall.bat", paths) or find_file("vcvars32.bat", paths) end - if not vcvarsall and version == "6.0" then - local paths = { - "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\DevStudio\\6.0\\Products\\Microsoft Visual C++;ProductDir)\\Bin", - "$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++;ProductDir)\\Bin" - } - vcvarsall = find_file("vcvars32.bat", paths) - end if not vcvarsall then local paths = { format("$(reg HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;%s)\\Common7\\Tools", version), -- cgit v1.3.1