diff options
| author | ruki <[email protected]> | 2020-05-24 21:10:49 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-24 21:10:49 +0800 |
| commit | fb2ba113ca1534249b0872002af0f133becd7e51 (patch) | |
| tree | d5bc9fb1553f622842712b18a7959a0c08a92d63 /xmake/platforms/linux/xmake.lua | |
| parent | dd09a2264181f82a0b6aefb38dce5c92fb3af8fe (diff) | |
| parent | 5ad2eaee8cd65987359dbdfc5149bdd61b9260fc (diff) | |
Merge pull request #792 from xmake-io/toolchain
Improve to detect cross-compilation toolchains
Diffstat (limited to 'xmake/platforms/linux/xmake.lua')
| -rw-r--r-- | xmake/platforms/linux/xmake.lua | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/xmake/platforms/linux/xmake.lua b/xmake/platforms/linux/xmake.lua index 53517239a..a1097565b 100644 --- a/xmake/platforms/linux/xmake.lua +++ b/xmake/platforms/linux/xmake.lua @@ -31,19 +31,26 @@ platform("linux") set_archs("i386", "x86_64", "armv7", "armv7s", "arm64-v8a", "mips", "mips64") -- set formats - set_formats {static = "lib$(name).a", object = "$(name).o", shared = "lib$(name).so", symbol = "$(name).sym"} + set_formats("static", "lib$(name).a") + set_formats("object", "$(name).o") + set_formats("shared", "lib$(name).so") + set_formats("symbol", "$(name).sym") -- set install directory set_installdir("/usr/local") - -- on check project configuration - on_config_check("config") + -- on check + on_check(function (platform) + import("core.project.config") + local arch = config.get("arch") + if not arch then + config.set("arch", os.arch()) + cprint("checking for the architecture ... ${color.success}%s", config.get("arch")) + end + end) - -- on check global configuration - on_global_check("global") - - -- on load - on_load("load") + -- set toolchains + set_toolchains("envs", "cross", "gcc", "clang", "yasm", "nasm", "fasm", "cuda", "dlang", "go", "rust") -- set menu set_menu { |
