Skip to content

Commit c9cf6e7

Browse files
authored
Merge pull request #5523 from ChrisCatCP/tools_cmake
use ALL_BUILD project build for msvc
2 parents 3fbd469 + 8eee558 commit c9cf6e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

xmake/modules/package/tools/cmake.lua

+6-4
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,9 @@ end
994994

995995
-- do build for msvc
996996
function _build_for_msvc(package, configs, opt)
997-
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
998-
msbuild.build(package, {slnfile, "-t:Rebuild"})
997+
local allbuild = os.isfile("ALL_BUILD.vcxproj") and "ALL_BUILD.vcxproj" or "ALL_BUILD.vcproj"
998+
assert(os.isfile(allbuild), "ALL_BUILD project not found!")
999+
msbuild.build(package, {allbuild, "-t:Rebuild"})
9991000
end
10001001

10011002
-- do build for make
@@ -1056,8 +1057,9 @@ end
10561057

10571058
-- do install for msvc
10581059
function _install_for_msvc(package, configs, opt)
1059-
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
1060-
msbuild.build(package, {slnfile, "-t:Rebuild", "/nr:false"})
1060+
local allbuild = os.isfile("ALL_BUILD.vcxproj") and "ALL_BUILD.vcxproj" or "ALL_BUILD.vcproj"
1061+
assert(os.isfile(allbuild), "ALL_BUILD project not found!")
1062+
msbuild.build(package, {allbuild, "-t:Rebuild", "/nr:false"})
10611063
local projfile = os.isfile("INSTALL.vcxproj") and "INSTALL.vcxproj" or "INSTALL.vcproj"
10621064
if os.isfile(projfile) then
10631065
msbuild.build(package, {projfile})

0 commit comments

Comments
 (0)