Skip to content

Commit

Permalink
Merge pull request #5523 from ChrisCatCP/tools_cmake
Browse files Browse the repository at this point in the history
use ALL_BUILD project build for msvc
  • Loading branch information
waruqi authored Aug 28, 2024
2 parents 3fbd469 + 8eee558 commit c9cf6e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions xmake/modules/package/tools/cmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -994,8 +994,9 @@ end

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

-- do build for make
Expand Down Expand Up @@ -1056,8 +1057,9 @@ end

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

0 comments on commit c9cf6e7

Please sign in to comment.