From c09a825d5c499f71a4fcb5774905a58e9647e4c5 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 20 Feb 2020 22:40:06 +0800 Subject: improve msbuild --- xmake/modules/private/action/trybuild/msbuild.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xmake/modules/private/action/trybuild/msbuild.lua b/xmake/modules/private/action/trybuild/msbuild.lua index 93a01ce78..f66676c26 100644 --- a/xmake/modules/private/action/trybuild/msbuild.lua +++ b/xmake/modules/private/action/trybuild/msbuild.lua @@ -31,11 +31,18 @@ end -- do clean function clean() + local configfile = find_file("*.sln", os.curdir()) + if configfile then + os.exec("msbuild \"%s\" -nologo -t:Clean -p:Configuration=Release -p:Platform=%s", configfile, is_arch("x64") and "x64" or "Win32") + end end -- do build function build() - os.exec("msbuild \"%s\" -nologo -t:Rebuild -p:Configuration=Release -p:Platform=%s", buildfile, os.arch() == "x64" and "x64" or "Win32") + local configfile = find_file("*.sln", os.curdir()) + if configfile then + os.exec("msbuild \"%s\" -nologo -t:Build -p:Configuration=Release -p:Platform=%s", configfile, is_arch("x64") and "x64" or "Win32") + end cprint("${bright}build ok!") end -- cgit v1.3.1