diff options
| author | ruki <[email protected]> | 2025-01-02 21:35:14 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-01-02 21:35:14 +0800 |
| commit | b1c10bb87af68fd7c6390b4da8f8f415b7758735 (patch) | |
| tree | 0b578f9ac9bbee9f0676b81cd028c79722d0231d | |
| parent | 686b414c97f5fae095676d06fbf62ddc3d0bb36f (diff) | |
| parent | 4c403499dd0459ddbddaa0063a9580c18a9b2618 (diff) | |
Merge pull request #6031 from Redbeanw44602/fix/clang-with-msvc-wine
Fix clang with msvc-wine
| -rw-r--r-- | xmake/modules/detect/sdks/find_vstudio.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/detect/tools/find_lld_link.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/package/tools/cmake.lua | 2 | ||||
| -rw-r--r-- | xmake/toolchains/clang-cl/xmake.lua | 2 |
4 files changed, 8 insertions, 5 deletions
diff --git a/xmake/modules/detect/sdks/find_vstudio.lua b/xmake/modules/detect/sdks/find_vstudio.lua index 52241cdc5..2b78b17c0 100644 --- a/xmake/modules/detect/sdks/find_vstudio.lua +++ b/xmake/modules/detect/sdks/find_vstudio.lua @@ -174,7 +174,11 @@ function find_build_tools(opt) if #lib ~= 0 then local vcvars = { BUILD_TOOLS_ROOT = sdkdir, - INCLUDE = path.joinenv(includedirs), + + -- vs runs in a windows ctx, so the envsep is always ";" + INCLUDE = path.joinenv(includedirs, ';'), + LIB = path.joinenv(lib, ';'), + WindowsSdkDir = variables.WindowsSdkDir, WindowsSDKVersion = WindowsSDKVersion, VCToolsInstallDir = variables.VCToolsInstallDir, @@ -193,7 +197,6 @@ function find_build_tools(opt) end vcvars.VSCMD_ARG_TGT_ARCH = target_arch - vcvars.LIB = path.joinenv(lib) vcvars.BUILD_TOOLS_BIN = path.joinenv(buidl_tools_bin) local PATH = buidl_tools_bin diff --git a/xmake/modules/detect/tools/find_lld_link.lua b/xmake/modules/detect/tools/find_lld_link.lua index 18641afdf..140e0efd1 100644 --- a/xmake/modules/detect/tools/find_lld_link.lua +++ b/xmake/modules/detect/tools/find_lld_link.lua @@ -38,7 +38,7 @@ import("lib.detect.find_programver") -- function main(opt) opt = opt or {} - local program = find_program(opt.program or "lld.link", opt) + local program = find_program(opt.program or "lld-link", opt) local version = nil if program and opt and opt.version then version = find_programver(program, opt) diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua index e83f254d8..e5c915ee0 100644 --- a/xmake/modules/package/tools/cmake.lua +++ b/xmake/modules/package/tools/cmake.lua @@ -652,7 +652,7 @@ function _get_configs_for_cross(package, configs, opt) envs.CMAKE_CXX_COMPILER = _translate_bin_path(package:build_getenv("cxx")) envs.CMAKE_ASM_COMPILER = _translate_bin_path(package:build_getenv("as")) envs.CMAKE_AR = _translate_bin_path(package:build_getenv("ar")) - if package:is_plat("windows") then + if package:is_plat("windows") and package:has_tool("cxx", "cl") then envs.CMAKE_AR = path.join(path.directory(envs.CMAKE_CXX_COMPILER), "lib.exe") end _fix_cxx_compiler_cmake(package, envs) diff --git a/xmake/toolchains/clang-cl/xmake.lua b/xmake/toolchains/clang-cl/xmake.lua index 443eba0a2..cc0263642 100644 --- a/xmake/toolchains/clang-cl/xmake.lua +++ b/xmake/toolchains/clang-cl/xmake.lua @@ -31,7 +31,7 @@ -- toolchain("clang-cl") set_kind("standalone") - set_homepage("https://visualstudio.microsoft.com") + set_homepage("https://clang.llvm.org/") set_description("LLVM Clang C/C++ Compiler compatible with msvc") set_runtimes("MT", "MTd", "MD", "MDd") |
