summaryrefslogtreecommitdiff
path: root/xmake/modules/package/tools/cmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-06-29 00:13:48 +0800
committerruki <[email protected]>2021-06-29 00:13:48 +0800
commitdfafd3cf0e433ddf6322474ae6133d59b2b67a14 (patch)
tree51e4dbb15039082c2f1ff31c95aec769dc52be9d /xmake/modules/package/tools/cmake.lua
parent086e0afb0c5ca2de85231a0cc4b6f52c93508d09 (diff)
fix tools/cmake
Diffstat (limited to 'xmake/modules/package/tools/cmake.lua')
-rw-r--r--xmake/modules/package/tools/cmake.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index bfeae2805..097069bf2 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -510,8 +510,11 @@ end
-- do build for msvc
function _build_for_msvc(package, configs, opt)
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
- local msbuild = find_tool("msbuild", {envs = _get_msvc_runenvs(package)})
- os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
+ local runenvs = _get_msvc_runenvs(package)
+ local msbuild = find_tool("msbuild", {envs = runenvs})
+ os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m",
+ "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"),
+ "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
end
-- do build for make
@@ -547,8 +550,11 @@ end
-- do install for msvc
function _install_for_msvc(package, configs, opt)
local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!")
- local msbuild = assert(find_tool("msbuild", {envs = _get_msvc_runenvs(package)}), "msbuild not found!")
- os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m", "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"), "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
+ local runenvs = _get_msvc_runenvs(package)
+ local msbuild = assert(find_tool("msbuild", {envs = runenvs}), "msbuild not found!")
+ os.vrunv(msbuild.program, {slnfile, "-nologo", "-t:Rebuild", "-m",
+ "-p:Configuration=" .. (package:is_debug() and "Debug" or "Release"),
+ "-p:Platform=" .. (package:is_arch("x64") and "x64" or "Win32")}, {envs = runenvs})
local projfile = os.isfile("INSTALL.vcxproj") and "INSTALL.vcxproj" or "INSTALL.vcproj"
if os.isfile(projfile) then
os.vrunv(msbuild.program, {projfile, "/property:configuration=" .. (package:is_debug() and "Debug" or "Release")}, {envs = runenvs})