summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorstar9029 <[email protected]>2024-11-15 20:59:01 +0800
committerstar9029 <[email protected]>2024-11-15 20:59:01 +0800
commite126a59290cf409e064fe970b62ed2aec125c25f (patch)
tree9f3674f0f8333cb6a2e1c582f840d6b3c094eeff /xmake/modules
parent5951d423b1c67187c47dbfd381b5c2fe9e8315a2 (diff)
support msvc-wine
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/detect/sdks/find_vstudio.lua14
-rw-r--r--xmake/modules/package/tools/cmake.lua8
2 files changed, 16 insertions, 6 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua
index 1c4e905c8..b65f5e660 100644
--- a/xmake/modules/detect/sdks/find_vstudio.lua
+++ b/xmake/modules/detect/sdks/find_vstudio.lua
@@ -189,12 +189,16 @@ function find_build_tools(opt)
VSCMD_ARG_HOST_ARCH = "x64",
}
+ local buidl_tools_bin = {}
local host_dir = "Host" .. vcvars.VSCMD_ARG_HOST_ARCH
- local buidl_tools_bin = {
- path.join(vcvars.VCToolsInstallDir, "bin", host_dir, target_arch),
- path.join(vcvars.WindowsSDKDir, "bin", WindowsSDKVersion),
- path.join(vcvars.WindowsSDKDir, "bin", WindowsSDKVersion, "ucrt"),
- }
+ if is_host("windows") then
+ table.insert(buidl_tools_bin, path.join(vcvars.VCToolsInstallDir, "bin", host_dir, target_arch))
+ table.insert(buidl_tools_bin, path.join(vcvars.WindowsSDKDir, "bin", WindowsSDKVersion))
+ table.insert(buidl_tools_bin, path.join(vcvars.WindowsSDKDir, "bin", WindowsSDKVersion, "ucrt"))
+ elseif is_host("linux") then
+ -- for msvc-wine
+ table.insert(buidl_tools_bin, path.join(sdkdir, "bin", target_arch))
+ end
vcvars.VSCMD_ARG_TGT_ARCH = target_arch
vcvars.LIB = path.joinenv(lib)
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index f0749bce0..741b63176 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -473,7 +473,11 @@ function _get_configs_for_windows(package, configs, opt)
if not opt._configs_str:find("CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY") then
table.insert(configs, "-DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=pdb")
end
- _get_configs_for_generic(package, configs, opt)
+ if package:is_cross() then
+ _get_configs_for_cross(package, configs, opt)
+ else
+ _get_configs_for_generic(package, configs, opt)
+ end
end
-- get configs for android
@@ -659,6 +663,8 @@ function _get_configs_for_cross(package, configs, opt)
local system_name = package:targetos() or "Linux"
if system_name == "linux" then
system_name = "Linux"
+ elseif system_name == "windows" then
+ system_name = "Windows"
end
envs.CMAKE_SYSTEM_NAME = system_name
end