diff options
| author | ruki <[email protected]> | 2020-11-12 22:35:13 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-11-12 22:35:13 +0800 |
| commit | 9a845fe45e97dcb078a89e0b9f5d27885a841660 (patch) | |
| tree | ffce6594b7416a916399f2bb5f45c4d02662c735 | |
| parent | ef8c228b9f176d140fffe0ecb8fe710c0d8d1ff9 (diff) | |
improve target_os for cross
| -rw-r--r-- | xmake/actions/config/xmake.lua | 2 | ||||
| -rw-r--r-- | xmake/toolchains/cross/check.lua | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/xmake/actions/config/xmake.lua b/xmake/actions/config/xmake.lua index 652e034b9..3399a027d 100644 --- a/xmake/actions/config/xmake.lua +++ b/xmake/actions/config/xmake.lua @@ -146,7 +146,7 @@ task("config") , "e.g." , " - i386-mingw32-" , " - arm-linux-androideabi-" } - , {nil, "target_os", "kv", "linux", "Set target os only for cross-complation" } + , {nil, "target_os", "kv", nil, "Set target os only for cross-complation" } , {nil, "bin", "kv", nil, "Set cross toolchains bin directory" , "e.g." , " - sdk/bin (/arm-linux-gcc ..)" } diff --git a/xmake/toolchains/cross/check.lua b/xmake/toolchains/cross/check.lua index ad62c83b2..35a6698e5 100644 --- a/xmake/toolchains/cross/check.lua +++ b/xmake/toolchains/cross/check.lua @@ -39,6 +39,10 @@ function main(toolchain) config.set("cross", cross_toolchain.cross, {readonly = true, force = true}) config.set("bin", cross_toolchain.bindir, {readonly = true, force = true}) config.set("sdk", cross_toolchain.sdkdir, {readonly = true, force = true}) + -- init default target os + if not config.get("target_os") then + config.set("target_os", "linux", {readonly = true, force = true}) + end else raise("cross toolchain not found!") end |
