diff options
| author | ruki <[email protected]> | 2021-02-10 23:31:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-10 23:31:34 +0800 |
| commit | d2e70dd2430454e9fcacc8a543d7710737e32ca1 (patch) | |
| tree | c242085385149c497ae48a57c136559dcca63cd0 | |
| parent | 0264096936203a11e4ea1d91b06f7c4fbb2a52d6 (diff) | |
move toolchain package to beginning
| -rw-r--r-- | tests/projects/package/toolchain_muslcc/xmake.lua | 6 | ||||
| -rw-r--r-- | xmake/actions/require/impl/package.lua | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/projects/package/toolchain_muslcc/xmake.lua b/tests/projects/package/toolchain_muslcc/xmake.lua index 930a116c7..48c048457 100644 --- a/tests/projects/package/toolchain_muslcc/xmake.lua +++ b/tests/projects/package/toolchain_muslcc/xmake.lua @@ -4,12 +4,12 @@ add_rules("mode.debug", "mode.release") set_plat("cross") set_arch("arm") --- add toolchains package -add_requires("muslcc") - -- add library packages add_requires("zlib", "libplist", {system = false}) +-- add toolchains package +add_requires("muslcc") + -- set global toolchains for target and packages set_toolchains("@muslcc") diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua index 6a9ccfcce..c23a5efa8 100644 --- a/xmake/actions/require/impl/package.lua +++ b/xmake/actions/require/impl/package.lua @@ -634,7 +634,12 @@ function _load_packages(requires, opt) end -- save this package - table.insert(packages, package) + -- @note if this root package is toolchain, we need to move it to the beginning in order to install first + if not opt.parentinfo and package:is_toolchain() then + table.insert(packages, 1, package) + else + table.insert(packages, package) + end end end return packages |
