diff options
| author | ruki <[email protected]> | 2023-08-08 23:52:48 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-08-08 23:52:48 +0800 |
| commit | 6ace9d5ab4735767b35d22cefd980e5f447db95c (patch) | |
| tree | ff48025d851bedd4d18385b1405edf476574cff6 /xmake/modules | |
| parent | 1494182a09187cf49edc9a19badc3be287e8a327 (diff) | |
add cross build
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/package/manager/cargo/configurations.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/package/manager/cargo/install_package.lua | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/xmake/modules/package/manager/cargo/configurations.lua b/xmake/modules/package/manager/cargo/configurations.lua index a233e7ccf..f151c1802 100644 --- a/xmake/modules/package/manager/cargo/configurations.lua +++ b/xmake/modules/package/manager/cargo/configurations.lua @@ -26,7 +26,6 @@ function main() default_features = {description = "Enable or disable any defaults provided by the dependency.", default = true}, std = {description = "Enable or disable std module."}, main = {description = "Enable or disable main entry function."}, - build_target = {description = "Set build target. e.g. aarch64-unknown-none"}, cargo_toml = {description = "Set Cargo.toml file path"} } end diff --git a/xmake/modules/package/manager/cargo/install_package.lua b/xmake/modules/package/manager/cargo/install_package.lua index 5bc28498b..60c059f40 100644 --- a/xmake/modules/package/manager/cargo/install_package.lua +++ b/xmake/modules/package/manager/cargo/install_package.lua @@ -132,8 +132,9 @@ target = "%s" -- do install local installdir = opt.installdir os.tryrm(path.join(installdir, "lib")) - if configs.build_target then - os.vcp(path.join(sourcedir, "target", configs.build_target, opt.mode == "debug" and "debug" or "release", "deps"), path.join(installdir, "lib")) + local cross = get_config("cross") + if cross then + os.vcp(path.join(sourcedir, "target", cross, opt.mode == "debug" and "debug" or "release", "deps"), path.join(installdir, "lib")) else os.vcp(path.join(sourcedir, "target", opt.mode == "debug" and "debug" or "release", "deps"), path.join(installdir, "lib")) end |
