summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
author白喵 <[email protected]>2024-08-28 14:45:35 +0800
committer白喵 <[email protected]>2024-08-28 14:45:35 +0800
commit8eee558af75cfc106ee862bc32c5d5804c4f908b (patch)
tree5f16cfa73858783ee952d410e997af48cc6c41a9 /xmake/modules/package/tools/cmake.lua
parent3fbd46931b4e51b9120b8ec15e8adb612fd222ec (diff)
use ALL_BUILD project build for msvc
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 4af3d22ad..01761f71c 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -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
@@ -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})