diff options
| -rw-r--r-- | xmake/actions/build/trybuild.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/actions/build/trybuild.lua b/xmake/actions/build/trybuild.lua index 526428496..898aae7c5 100644 --- a/xmake/actions/build/trybuild.lua +++ b/xmake/actions/build/trybuild.lua @@ -46,7 +46,11 @@ end function _build_for_cmakelists(buildfile) os.mkdir("build") os.cd("build") - os.vrun("cmake -A %s -DCMAKE_INSTALL_PREFIX=\"%s\" ..", os.arch(), path.absolute("install")) + if is_host("windows") and os.arch() == "x64" then + os.vrun("cmake -A x64 -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")) + else + os.vrun("cmake -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")) + end if is_host("windows") then local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!") diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index 0eeef1bfc..2334f449f 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -30,7 +30,11 @@ import("lib.detect.find_file") function install(package, configs) os.mkdir("build/install") local oldir = os.cd("build") - os.vrun("cmake -A $(arch) -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")) + if is_plat("windows") and is_arch("x64") then + os.vrun("cmake -A x64 -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")) + else + os.vrun("cmake -DCMAKE_INSTALL_PREFIX=\"%s\" ..", path.absolute("install")) + end if is_host("windows") then local slnfile = assert(find_file("*.sln", os.curdir()), "*.sln file not found!") os.vrun("msbuild \"%s\" -nologo -t:Rebuild -p:Configuration=%s -p:Platform=%s", slnfile, package:debug() and "Debug" or "Release", is_arch("x64") and "x64" or "Win32") |
