diff options
| author | ruki <[email protected]> | 2025-05-10 15:55:38 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-10 15:55:38 +0800 |
| commit | 5e8108b5b9eb58e4e2e38c3015ea46fc1d4c2c72 (patch) | |
| tree | b764f7dc312890d96341c54b323eb73822f830d5 | |
| parent | 5e3c763b1ace6ab5e03dfa997cf681857de9993a (diff) | |
| parent | e0b4e4e69b752593f90e03ee1e857092143c712b (diff) | |
Merge pull request #6416 from SirLynix/rust-targetriple
Make rustc target_triple public
| -rw-r--r-- | xmake/modules/core/tools/rustc/target_triple.lua (renamed from xmake/modules/private/tools/rust/target_triple.lua) | 4 | ||||
| -rw-r--r-- | xmake/modules/package/manager/cargo/install_package.lua | 2 | ||||
| -rw-r--r-- | xmake/toolchains/rust/xmake.lua | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/xmake/modules/private/tools/rust/target_triple.lua b/xmake/modules/core/tools/rustc/target_triple.lua index 3a83aed7e..ddbf052ea 100644 --- a/xmake/modules/private/tools/rust/target_triple.lua +++ b/xmake/modules/core/tools/rustc/target_triple.lua @@ -45,9 +45,9 @@ end function _translate_plat(plat, arch, opt) if plat == "windows" then return "-pc-windows-msvc" - elseif plat == "mingw" then + elseif plat == "mingw" or plat == "msys" then return "-pc-windows-gnu" - elseif plat == "linux" then + elseif plat == "linux" or plat == "cross" then return "-unknown-linux-gnu" elseif plat == "macosx" then return "-apple-darwin" diff --git a/xmake/modules/package/manager/cargo/install_package.lua b/xmake/modules/package/manager/cargo/install_package.lua index 9f5d069cb..a5fe7f423 100644 --- a/xmake/modules/package/manager/cargo/install_package.lua +++ b/xmake/modules/package/manager/cargo/install_package.lua @@ -21,9 +21,9 @@ -- imports import("core.base.option") import("core.project.config") +import("core.tools.rustc.target_triple") import("lib.detect.find_tool") import("private.tools.rust.check_target") -import("private.tools.rust.target_triple") -- translate local path in dependencies -- @see https://github.com/xmake-io/xmake/issues/4222 diff --git a/xmake/toolchains/rust/xmake.lua b/xmake/toolchains/rust/xmake.lua index a17dc3517..95c0f189a 100644 --- a/xmake/toolchains/rust/xmake.lua +++ b/xmake/toolchains/rust/xmake.lua @@ -28,7 +28,7 @@ toolchain("rust") set_toolset("rcar", "$(env RC)", "rustc") on_load(function (toolchain) - import("private.tools.rust.target_triple") + import("core.tools.rustc.target_triple") local opt = {} if toolchain:config("appledev") == "simulator" then |
