summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-10 16:09:45 +0800
committerruki <[email protected]>2025-09-10 16:13:06 +0800
commitec5d3392505ddb0894a313432fb59260310573a5 (patch)
tree394e0d915574e657cfc7697afb01a89f4c22ddcd
parent73e8fef22ad9381e525962104a60b97e37cdf209 (diff)
support for vs2026
-rw-r--r--xmake/modules/detect/sdks/find_vstudio.lua6
-rw-r--r--xmake/modules/private/action/trybuild/cmake.lua2
-rw-r--r--xmake/modules/private/action/trybuild/msbuild.lua2
-rw-r--r--xmake/plugins/project/main.lua2
-rw-r--r--xmake/plugins/project/vstudio/impl/vsinfo.lua8
-rw-r--r--xmake/scripts/vsxmake/vsproj/Xmake.props1
6 files changed, 17 insertions, 4 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua
index ba81d1993..cf56fcca9 100644
--- a/xmake/modules/detect/sdks/find_vstudio.lua
+++ b/xmake/modules/detect/sdks/find_vstudio.lua
@@ -56,7 +56,8 @@ local vcvars = {"path",
-- init vsvers
local vsvers =
{
- ["17.0"] = "2022"
+ ["18.0"] = "2026"
+, ["17.0"] = "2022"
, ["16.0"] = "2019"
, ["15.0"] = "2017"
, ["14.0"] = "2015"
@@ -75,7 +76,8 @@ local vsvers =
-- init vsenvs
local vsenvs =
{
- ["17.0"] = "VS170COMNTOOLS"
+ ["18.0"] = "VS180COMNTOOLS"
+, ["17.0"] = "VS170COMNTOOLS"
, ["16.0"] = "VS160COMNTOOLS"
, ["15.0"] = "VS150COMNTOOLS"
, ["14.0"] = "VS140COMNTOOLS"
diff --git a/xmake/modules/private/action/trybuild/cmake.lua b/xmake/modules/private/action/trybuild/cmake.lua
index 3cf96c7e3..2957231ad 100644
--- a/xmake/modules/private/action/trybuild/cmake.lua
+++ b/xmake/modules/private/action/trybuild/cmake.lua
@@ -500,7 +500,7 @@ end
function _build_for_msvc(opt)
local runenvs = _get_msvc_runenvs()
local msbuild = find_tool("msbuild", {envs = runenvs})
- local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
+ local slnfile = assert(find_file("*.sln", os.curdir()) or find_file("*.slnx", os.curdir()), "*.sln/slnx file not found!")
os.vexecv(msbuild.program, {slnfile, "-nologo", "-t:Build", "-m",
"-p:Configuration=" .. (is_mode("debug") and "Debug" or "Release"),
"-p:Platform=" .. _get_vsarch()}, {envs = runenvs})
diff --git a/xmake/modules/private/action/trybuild/msbuild.lua b/xmake/modules/private/action/trybuild/msbuild.lua
index 665bbf72c..a2baa9a6d 100644
--- a/xmake/modules/private/action/trybuild/msbuild.lua
+++ b/xmake/modules/private/action/trybuild/msbuild.lua
@@ -27,7 +27,7 @@ import("lib.detect.find_tool")
-- find project file
function _find_projectfile()
- return find_file("*.sln", os.curdir())
+ return find_file("*.sln", os.curdir()) or find_file("*.slnx", os.curdir())
end
-- detect build-system and configuration file
diff --git a/xmake/plugins/project/main.lua b/xmake/plugins/project/main.lua
index 9b85f0b6f..d48f6662d 100644
--- a/xmake/plugins/project/main.lua
+++ b/xmake/plugins/project/main.lua
@@ -54,6 +54,7 @@ function makers()
, vs2017 = vs.make(2017)
, vs2019 = vs.make(2019)
, vs2022 = vs.make(2022)
+ , vs2026 = vs.make(2026)
, vs = vs.make()
, vsxmake2010 = vsxmake.make(2010)
, vsxmake2012 = vsxmake.make(2012)
@@ -62,6 +63,7 @@ function makers()
, vsxmake2017 = vsxmake.make(2017)
, vsxmake2019 = vsxmake.make(2019)
, vsxmake2022 = vsxmake.make(2022)
+ , vsxmake2026 = vsxmake.make(2026)
, vsxmake = vsxmake.make()
, compile_flags = compile_flags.make
, compile_commands = compile_commands.make
diff --git a/xmake/plugins/project/vstudio/impl/vsinfo.lua b/xmake/plugins/project/vstudio/impl/vsinfo.lua
index 1743f00ab..2168e734d 100644
--- a/xmake/plugins/project/vstudio/impl/vsinfo.lua
+++ b/xmake/plugins/project/vstudio/impl/vsinfo.lua
@@ -93,6 +93,14 @@ local vsinfo =
, toolset_version = "v143"
, sdk_version = "10.0.19041.0"
}
+, [2026] =
+ { vstudio_version = "2026"
+ , project_version = "18"
+ , filters_version = "4.0"
+ , solution_version = "12"
+ , toolset_version = "v145"
+ , sdk_version = "10.0.26100.0"
+ }
}
function main(version)
diff --git a/xmake/scripts/vsxmake/vsproj/Xmake.props b/xmake/scripts/vsxmake/vsproj/Xmake.props
index 0c8f0e987..e2bf58dfe 100644
--- a/xmake/scripts/vsxmake/vsproj/Xmake.props
+++ b/xmake/scripts/vsxmake/vsproj/Xmake.props
@@ -58,6 +58,7 @@
<PlatformToolset Condition="'$(VisualStudioVersion)' == '15.0'">v141</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
<PlatformToolset Condition="'$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
+ <PlatformToolset Condition="'$(VisualStudioVersion)' == '18.0'">v145</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="AdditionalProps">