diff options
| author | ruki <[email protected]> | 2017-06-19 13:11:18 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-06-19 13:11:18 +0800 |
| commit | bab3c46dbb5e6443ddf52c58099266e236450312 (patch) | |
| tree | 39b771880db93291e263b7532babe6b7bc50f7e7 | |
| parent | 5955e98a081d7474e1701e5fcf76a30b63f9b000 (diff) | |
improve find toolchains from env vals
| -rw-r--r-- | xmake/platforms/checker.lua | 15 | ||||
| -rw-r--r-- | xmake/platforms/linux/check.lua | 117 | ||||
| -rw-r--r-- | xmake/platforms/macosx/check.lua | 100 | ||||
| -rw-r--r-- | xmake/platforms/mingw/check.lua | 20 | ||||
| -rw-r--r-- | xmake/platforms/windows/check.lua | 62 |
5 files changed, 179 insertions, 135 deletions
diff --git a/xmake/platforms/checker.lua b/xmake/platforms/checker.lua index 3672649e9..458b5f0d5 100644 --- a/xmake/platforms/checker.lua +++ b/xmake/platforms/checker.lua @@ -36,20 +36,15 @@ function _toolchain_check(config, toolkind, toolinfo) local toolpath = config.get(toolkind) if not toolpath then - -- get name - local name = toolinfo.name + -- get name and attempt to get `$(env XX)` + local name = vformat(toolinfo.name) + if #name == 0 then + return + end -- get cross local cross = config.get("cross") or toolinfo.cross or "" - -- get program name from the env if not cross-compilation - if config.get("plat") == os.host() and config.get("arch") ==os.arch() then - local program = os.getenv(toolkind:upper():split('-')[1]) - if program and program:trim() ~= "" then - toolpath = find_tool(find_toolname(program), {program = program}) - end - end - -- attempt to check it if not toolpath then toolpath = find_tool(name, {program = cross .. name, pathes = config.get("toolchains"), check = toolinfo.check}) diff --git a/xmake/platforms/linux/check.lua b/xmake/platforms/linux/check.lua index 82e7737cc..260c8ca9f 100644 --- a/xmake/platforms/linux/check.lua +++ b/xmake/platforms/linux/check.lua @@ -63,63 +63,88 @@ function _toolchains(config) -- init toolchains local toolchains = {} + -- inset tools from environment variables if not cross-compilation + if #cross == 0 then + checker.toolchain_insert(toolchains, "cc", "", "$(env CC)", "the c compiler") + checker.toolchain_insert(toolchains, "cxx", "", "$(env CXX)", "the linker") + checker.toolchain_insert(toolchains, "ld", "", "$(env LD)", "the linker") + checker.toolchain_insert(toolchains, "ld", "", "$(env CXX)", "the linker") + checker.toolchain_insert(toolchains, "ld", "", "$(env CC)", "the linker") + checker.toolchain_insert(toolchains, "ar", "", "$(env AR)", "the static library archiver") + checker.toolchain_insert(toolchains, "sh", "", "$(env SH)", "the shared library linker") + checker.toolchain_insert(toolchains, "mm", "", "$(env MM)", "the objc compiler") + checker.toolchain_insert(toolchains, "mxx", "", "$(env MXX)", "the objc++ compiler") + checker.toolchain_insert(toolchains, "as", "", "$(env AS)", "the assember") + end + -- insert c/c++ tools to toolchains - checker.toolchain_insert(toolchains, "cc", cross, "gcc", "the c compiler") - checker.toolchain_insert(toolchains, "cc", cross, "clang", "the c compiler") - checker.toolchain_insert(toolchains, "cxx", cross, "gcc", "the c++ compiler") - checker.toolchain_insert(toolchains, "cxx", cross, "clang", "the c++ compiler") - checker.toolchain_insert(toolchains, "cxx", cross, "g++", "the c++ compiler") - checker.toolchain_insert(toolchains, "cxx", cross, "clang++", "the c++ compiler") - checker.toolchain_insert(toolchains, "ld", cross, "g++", "the linker") - checker.toolchain_insert(toolchains, "ld", cross, "gcc", "the linker") - checker.toolchain_insert(toolchains, "ld", cross, "clang++", "the linker") - checker.toolchain_insert(toolchains, "ld", cross, "clang", "the linker") - checker.toolchain_insert(toolchains, "ar", cross, "ar", "the static library archiver") - checker.toolchain_insert(toolchains, "ex", cross, "ar", "the static library extractor") - checker.toolchain_insert(toolchains, "sh", cross, "g++", "the shared library linker") - checker.toolchain_insert(toolchains, "sh", cross, "gcc", "the shared library linker") - checker.toolchain_insert(toolchains, "sh", cross, "clang++", "the shared library linker") - checker.toolchain_insert(toolchains, "sh", cross, "clang", "the shared library linker") + checker.toolchain_insert(toolchains, "cc", cross, "gcc", "the c compiler") + checker.toolchain_insert(toolchains, "cc", cross, "clang", "the c compiler") + checker.toolchain_insert(toolchains, "cxx", cross, "gcc", "the c++ compiler") + checker.toolchain_insert(toolchains, "cxx", cross, "clang", "the c++ compiler") + checker.toolchain_insert(toolchains, "cxx", cross, "g++", "the c++ compiler") + checker.toolchain_insert(toolchains, "cxx", cross, "clang++", "the c++ compiler") + checker.toolchain_insert(toolchains, "ld", cross, "g++", "the linker") + checker.toolchain_insert(toolchains, "ld", cross, "gcc", "the linker") + checker.toolchain_insert(toolchains, "ld", cross, "clang++", "the linker") + checker.toolchain_insert(toolchains, "ld", cross, "clang", "the linker") + checker.toolchain_insert(toolchains, "ar", cross, "ar", "the static library archiver") + checker.toolchain_insert(toolchains, "ex", cross, "ar", "the static library extractor") + checker.toolchain_insert(toolchains, "sh", cross, "g++", "the shared library linker") + checker.toolchain_insert(toolchains, "sh", cross, "gcc", "the shared library linker") + checker.toolchain_insert(toolchains, "sh", cross, "clang++", "the shared library linker") + checker.toolchain_insert(toolchains, "sh", cross, "clang", "the shared library linker") -- insert objc/c++ tools to toolchains - checker.toolchain_insert(toolchains, "mm", cross, "clang", "the objc compiler") - checker.toolchain_insert(toolchains, "mm", cross, "gcc", "the objc compiler") - checker.toolchain_insert(toolchains, "mxx", cross, "clang++", "the objc++ compiler") - checker.toolchain_insert(toolchains, "mxx", cross, "clang", "the objc++ compiler") - checker.toolchain_insert(toolchains, "mxx", cross, "g++", "the objc++ compiler") - checker.toolchain_insert(toolchains, "mxx", cross, "gcc", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mm", cross, "clang", "the objc compiler") + checker.toolchain_insert(toolchains, "mm", cross, "gcc", "the objc compiler") + checker.toolchain_insert(toolchains, "mxx", cross, "clang++", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mxx", cross, "clang", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mxx", cross, "g++", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mxx", cross, "gcc", "the objc++ compiler") -- insert asm tools to toolchains - checker.toolchain_insert(toolchains, "as", cross, "clang", "the assember") - checker.toolchain_insert(toolchains, "as", cross, "gcc", "the assember") + checker.toolchain_insert(toolchains, "as", cross, "clang", "the assember") + checker.toolchain_insert(toolchains, "as", cross, "gcc", "the assember") -- insert golang tools to toolchains - checker.toolchain_insert(toolchains, "gc", "", "go", "the golang compiler") - checker.toolchain_insert(toolchains, "gc", "", "gccgo", "the golang compiler") - checker.toolchain_insert(toolchains, "gc-ar", "", "go", "the golang static library archiver") - checker.toolchain_insert(toolchains, "gc-ar", "", "gccgo", "the golang static library archiver") - checker.toolchain_insert(toolchains, "gc-ld", "", "go", "the golang linker") - checker.toolchain_insert(toolchains, "gc-ld", "", "gccgo", "the golang linker") + checker.toolchain_insert(toolchains, "gc", "", "$(env GC)", "the golang compiler") + checker.toolchain_insert(toolchains, "gc-ar", "", "$(env GC)", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ld", "", "$(env GC)", "the golang linker") + checker.toolchain_insert(toolchains, "gc", "", "go", "the golang compiler") + checker.toolchain_insert(toolchains, "gc", "", "gccgo", "the golang compiler") + checker.toolchain_insert(toolchains, "gc-ar", "", "go", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ar", "", "gccgo", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ld", "", "go", "the golang linker") + checker.toolchain_insert(toolchains, "gc-ld", "", "gccgo", "the golang linker") -- insert dlang tools to toolchains - checker.toolchain_insert(toolchains, "dc", "", "dmd", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc", "", "ldc2", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc", "", "gdc", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc-ar", "", "dmd", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-ar", "", "ldc2", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-ar", "", "gdc", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-sh", "", "dmd", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-sh", "", "ldc2", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-sh", "", "gdc", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "dmd", "the dlang linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "ldc2", "the dlang linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "gdc", "the dlang linker") + checker.toolchain_insert(toolchains, "dc", "", "$(env DC)", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc-ar", "", "$(env Dc)", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-sh", "", "$(env DC)", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "$(env DC)", "the dlang linker") + checker.toolchain_insert(toolchains, "dc", "", "dmd", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc", "", "ldc2", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc", "", "gdc", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc-ar", "", "dmd", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-ar", "", "ldc2", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-ar", "", "gdc", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-sh", "", "dmd", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-sh", "", "ldc2", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-sh", "", "gdc", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "dmd", "the dlang linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "ldc2", "the dlang linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "gdc", "the dlang linker") -- insert rust tools to toolchains - checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler") - checker.toolchain_insert(toolchains, "rc-ar", "", "rustc", "the rust static library archiver") - checker.toolchain_insert(toolchains, "rc-sh", "", "rustc", "the rust shared library linker") - checker.toolchain_insert(toolchains, "rc-ld", "", "rustc", "the rust linker") + checker.toolchain_insert(toolchains, "rc", "", "$(env RC)", "the rust compiler") + checker.toolchain_insert(toolchains, "rc-ar", "", "$(env RC)", "the rust static library archiver") + checker.toolchain_insert(toolchains, "rc-sh", "", "$(env RC)", "the rust shared library linker") + checker.toolchain_insert(toolchains, "rc-ld", "", "$(env RC)", "the rust linker") + checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler") + checker.toolchain_insert(toolchains, "rc-ar", "", "rustc", "the rust static library archiver") + checker.toolchain_insert(toolchains, "rc-sh", "", "rustc", "the rust shared library linker") + checker.toolchain_insert(toolchains, "rc-ld", "", "rustc", "the rust linker") -- save toolchains _g.TOOLCHAINS = toolchains diff --git a/xmake/platforms/macosx/check.lua b/xmake/platforms/macosx/check.lua index 56d4e48c6..aec349e4c 100644 --- a/xmake/platforms/macosx/check.lua +++ b/xmake/platforms/macosx/check.lua @@ -37,56 +37,80 @@ function _toolchains(config) local toolchains = {} -- insert c/c++ tools to toolchains - checker.toolchain_insert(toolchains, "cc", "xcrun -sdk macosx ", "clang", "the c compiler") - checker.toolchain_insert(toolchains, "cxx", "xcrun -sdk macosx ", "clang", "the c++ compiler") - checker.toolchain_insert(toolchains, "cxx", "xcrun -sdk macosx ", "clang++", "the c++ compiler") - checker.toolchain_insert(toolchains, "ld", "xcrun -sdk macosx ", "clang++", "the linker") - checker.toolchain_insert(toolchains, "ld", "xcrun -sdk macosx ", "clang", "the linker") - checker.toolchain_insert(toolchains, "ar", "xcrun -sdk macosx ", "ar", "the static library archiver") - checker.toolchain_insert(toolchains, "ex", "xcrun -sdk macosx ", "ar", "the static library extractor") - checker.toolchain_insert(toolchains, "sh", "xcrun -sdk macosx ", "clang++", "the shared library linker") - checker.toolchain_insert(toolchains, "sh", "xcrun -sdk macosx ", "clang", "the shared library linker") + checker.toolchain_insert(toolchains, "cc", "", "$(env CC)", "the c compiler") + checker.toolchain_insert(toolchains, "cxx", "", "$(env CXX)", "the linker") + checker.toolchain_insert(toolchains, "ld", "", "$(env LD)", "the linker") + checker.toolchain_insert(toolchains, "ld", "", "$(env CXX)", "the linker") + checker.toolchain_insert(toolchains, "ld", "", "$(env CC)", "the linker") + checker.toolchain_insert(toolchains, "ar", "", "$(env AR)", "the static library archiver") + checker.toolchain_insert(toolchains, "sh", "", "$(env SH)", "the shared library linker") + checker.toolchain_insert(toolchains, "cc", "xcrun -sdk macosx ", "clang", "the c compiler") + checker.toolchain_insert(toolchains, "cxx", "xcrun -sdk macosx ", "clang", "the c++ compiler") + checker.toolchain_insert(toolchains, "cxx", "xcrun -sdk macosx ", "clang++", "the c++ compiler") + checker.toolchain_insert(toolchains, "ld", "xcrun -sdk macosx ", "clang++", "the linker") + checker.toolchain_insert(toolchains, "ld", "xcrun -sdk macosx ", "clang", "the linker") + checker.toolchain_insert(toolchains, "ar", "xcrun -sdk macosx ", "ar", "the static library archiver") + checker.toolchain_insert(toolchains, "ex", "xcrun -sdk macosx ", "ar", "the static library extractor") + checker.toolchain_insert(toolchains, "sh", "xcrun -sdk macosx ", "clang++", "the shared library linker") + checker.toolchain_insert(toolchains, "sh", "xcrun -sdk macosx ", "clang", "the shared library linker") -- insert objc/c++ tools to toolchains - checker.toolchain_insert(toolchains, "mm", "xcrun -sdk macosx ", "clang", "the objc compiler") - checker.toolchain_insert(toolchains, "mxx", "xcrun -sdk macosx ", "clang++", "the objc++ compiler") - checker.toolchain_insert(toolchains, "mxx", "xcrun -sdk macosx ", "clang", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mm", "", "$(env MM)", "the objc compiler") + checker.toolchain_insert(toolchains, "mxx", "", "$(env MXX)", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mm", "xcrun -sdk macosx ", "clang", "the objc compiler") + checker.toolchain_insert(toolchains, "mxx", "xcrun -sdk macosx ", "clang++", "the objc++ compiler") + checker.toolchain_insert(toolchains, "mxx", "xcrun -sdk macosx ", "clang", "the objc++ compiler") -- insert asm tools to toolchains - checker.toolchain_insert(toolchains, "as", "xcrun -sdk macosx ", "clang", "the assember") + checker.toolchain_insert(toolchains, "as", "", "$(env AS)", "the assember") + checker.toolchain_insert(toolchains, "as", "xcrun -sdk macosx ", "clang", "the assember") -- insert swift tools to toolchains - checker.toolchain_insert(toolchains, "sc", "xcrun -sdk macosx ", "swiftc", "the swift compiler") - checker.toolchain_insert(toolchains, "sc-ld", "xcrun -sdk macosx ", "swiftc", "the swift linker") - checker.toolchain_insert(toolchains, "sc-sh", "xcrun -sdk macosx ", "swiftc", "the swift shared library linker") + checker.toolchain_insert(toolchains, "sc", "", "$(env SC)", "the swift compiler") + checker.toolchain_insert(toolchains, "sc-ld", "", "$(env SC)", "the swift linker") + checker.toolchain_insert(toolchains, "sc-sh", "", "$(env SC)", "the swift shared library linker") + checker.toolchain_insert(toolchains, "sc", "xcrun -sdk macosx ", "swiftc", "the swift compiler") + checker.toolchain_insert(toolchains, "sc-ld", "xcrun -sdk macosx ", "swiftc", "the swift linker") + checker.toolchain_insert(toolchains, "sc-sh", "xcrun -sdk macosx ", "swiftc", "the swift shared library linker") -- insert golang tools to toolchains - checker.toolchain_insert(toolchains, "gc", "", "go", "the golang compiler") - checker.toolchain_insert(toolchains, "gc", "", "gccgo", "the golang compiler") - checker.toolchain_insert(toolchains, "gc-ar", "", "go", "the golang static library archiver") - checker.toolchain_insert(toolchains, "gc-ar", "", "gccgo", "the golang static library archiver") - checker.toolchain_insert(toolchains, "gc-ld", "", "go", "the golang linker") - checker.toolchain_insert(toolchains, "gc-ld", "", "gccgo", "the golang linker") + checker.toolchain_insert(toolchains, "gc", "", "$(env GC)", "the golang compiler") + checker.toolchain_insert(toolchains, "gc-ar", "", "$(env GC)", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ld", "", "$(env GC)", "the golang linker") + checker.toolchain_insert(toolchains, "gc", "", "go", "the golang compiler") + checker.toolchain_insert(toolchains, "gc", "", "gccgo", "the golang compiler") + checker.toolchain_insert(toolchains, "gc-ar", "", "go", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ar", "", "gccgo", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ld", "", "go", "the golang linker") + checker.toolchain_insert(toolchains, "gc-ld", "", "gccgo", "the golang linker") -- insert dlang tools to toolchains - checker.toolchain_insert(toolchains, "dc", "", "dmd", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc", "", "ldc2", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc", "", "gdc", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc-ar", "", "dmd", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-ar", "", "ldc2", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-ar", "", "gdc", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-sh", "", "dmd", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-sh", "", "ldc2", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-sh", "", "gdc", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "dmd", "the dlang linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "ldc2", "the dlang linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "gdc", "the dlang linker") + checker.toolchain_insert(toolchains, "dc", "", "$(env DC)", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc-ar", "", "$(env Dc)", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-sh", "", "$(env DC)", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "$(env DC)", "the dlang linker") + checker.toolchain_insert(toolchains, "dc", "", "dmd", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc", "", "ldc2", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc", "", "gdc", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc-ar", "", "dmd", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-ar", "", "ldc2", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-ar", "", "gdc", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-sh", "", "dmd", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-sh", "", "ldc2", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-sh", "", "gdc", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "dmd", "the dlang linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "ldc2", "the dlang linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "gdc", "the dlang linker") -- insert rust tools to toolchains - checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler") - checker.toolchain_insert(toolchains, "rc-ar", "", "rustc", "the rust static library archiver") - checker.toolchain_insert(toolchains, "rc-sh", "", "rustc", "the rust shared library linker") - checker.toolchain_insert(toolchains, "rc-ld", "", "rustc", "the rust linker") + checker.toolchain_insert(toolchains, "rc", "", "$(env RC)", "the rust compiler") + checker.toolchain_insert(toolchains, "rc-ar", "", "$(env RC)", "the rust static library archiver") + checker.toolchain_insert(toolchains, "rc-sh", "", "$(env RC)", "the rust shared library linker") + checker.toolchain_insert(toolchains, "rc-ld", "", "$(env RC)", "the rust linker") + checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler") + checker.toolchain_insert(toolchains, "rc-ar", "", "rustc", "the rust static library archiver") + checker.toolchain_insert(toolchains, "rc-sh", "", "rustc", "the rust shared library linker") + checker.toolchain_insert(toolchains, "rc-ld", "", "rustc", "the rust linker") -- save toolchains _g.TOOLCHAINS = toolchains diff --git a/xmake/platforms/mingw/check.lua b/xmake/platforms/mingw/check.lua index 887aa43db..c68d3b9a2 100644 --- a/xmake/platforms/mingw/check.lua +++ b/xmake/platforms/mingw/check.lua @@ -53,16 +53,16 @@ function _toolchains(config) -- make toolchains local toolchains = {} - checker.toolchain_insert(toolchains, "cc", cross, "gcc", "the c compiler") - checker.toolchain_insert(toolchains, "cxx", cross, "g++", "the c++ compiler") - checker.toolchain_insert(toolchains, "cxx", cross, "gcc", "the c++ compiler") - checker.toolchain_insert(toolchains, "as", cross, "gcc", "the assember") - checker.toolchain_insert(toolchains, "ld", cross, "g++", "the linker") - checker.toolchain_insert(toolchains, "ld", cross, "gcc", "the linker") - checker.toolchain_insert(toolchains, "ar", cross, "ar", "the static library archiver") - checker.toolchain_insert(toolchains, "ex", cross, "ar", "the static library extractor") - checker.toolchain_insert(toolchains, "sh", cross, "g++", "the shared library linker") - checker.toolchain_insert(toolchains, "sh", cross, "gcc", "the shared library linker") + checker.toolchain_insert(toolchains, "cc", cross, "gcc", "the c compiler") + checker.toolchain_insert(toolchains, "cxx", cross, "g++", "the c++ compiler") + checker.toolchain_insert(toolchains, "cxx", cross, "gcc", "the c++ compiler") + checker.toolchain_insert(toolchains, "as", cross, "gcc", "the assember") + checker.toolchain_insert(toolchains, "ld", cross, "g++", "the linker") + checker.toolchain_insert(toolchains, "ld", cross, "gcc", "the linker") + checker.toolchain_insert(toolchains, "ar", cross, "ar", "the static library archiver") + checker.toolchain_insert(toolchains, "ex", cross, "ar", "the static library extractor") + checker.toolchain_insert(toolchains, "sh", cross, "g++", "the shared library linker") + checker.toolchain_insert(toolchains, "sh", cross, "gcc", "the shared library linker") -- save toolchains _g.TOOLCHAINS = toolchains diff --git a/xmake/platforms/windows/check.lua b/xmake/platforms/windows/check.lua index 28ad939bc..75a8c5dee 100644 --- a/xmake/platforms/windows/check.lua +++ b/xmake/platforms/windows/check.lua @@ -119,47 +119,47 @@ function _toolchains(config) local toolchains = {} -- insert c/c++ tools to toolchains - checker.toolchain_insert(toolchains, "cc", "", "cl.exe", "the c compiler") - checker.toolchain_insert(toolchains, "cxx", "", "cl.exe", "the c++ compiler") - checker.toolchain_insert(toolchains, "mrc", "", "rc.exe", "the resource compiler") - checker.toolchain_insert(toolchains, "ld", "", "link.exe", "the linker") - checker.toolchain_insert(toolchains, "ar", "", "link.exe -lib", "the static library archiver") - checker.toolchain_insert(toolchains, "sh", "", "link.exe -dll", "the shared library linker") - checker.toolchain_insert(toolchains, "ex", "", "lib.exe", "the static library extractor") + checker.toolchain_insert(toolchains, "cc", "", "cl.exe", "the c compiler") + checker.toolchain_insert(toolchains, "cxx", "", "cl.exe", "the c++ compiler") + checker.toolchain_insert(toolchains, "mrc", "", "rc.exe", "the resource compiler") + checker.toolchain_insert(toolchains, "ld", "", "link.exe", "the linker") + checker.toolchain_insert(toolchains, "ar", "", "link.exe -lib", "the static library archiver") + checker.toolchain_insert(toolchains, "sh", "", "link.exe -dll", "the shared library linker") + checker.toolchain_insert(toolchains, "ex", "", "lib.exe", "the static library extractor") -- insert golang tools to toolchains - checker.toolchain_insert(toolchains, "gc", "", "go", "the golang compiler") - checker.toolchain_insert(toolchains, "gc", "", "gccgo", "the golang compiler") - checker.toolchain_insert(toolchains, "gc-ar", "", "go", "the golang static library archiver") - checker.toolchain_insert(toolchains, "gc-ar", "", "gccgo", "the golang static library archiver") - checker.toolchain_insert(toolchains, "gc-ld", "", "go", "the golang linker") - checker.toolchain_insert(toolchains, "gc-ld", "", "gccgo", "the golang linker") + checker.toolchain_insert(toolchains, "gc", "", "go", "the golang compiler") + checker.toolchain_insert(toolchains, "gc", "", "gccgo", "the golang compiler") + checker.toolchain_insert(toolchains, "gc-ar", "", "go", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ar", "", "gccgo", "the golang static library archiver") + checker.toolchain_insert(toolchains, "gc-ld", "", "go", "the golang linker") + checker.toolchain_insert(toolchains, "gc-ld", "", "gccgo", "the golang linker") -- insert dlang tools to toolchains - checker.toolchain_insert(toolchains, "dc", "", "dmd", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc", "", "ldc2", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc", "", "gdc", "the dlang compiler") - checker.toolchain_insert(toolchains, "dc-ar", "", "dmd", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-ar", "", "ldc2", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-ar", "", "gdc", "the dlang static library archiver") - checker.toolchain_insert(toolchains, "dc-sh", "", "dmd", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-sh", "", "ldc2", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-sh", "", "gdc", "the dlang shared library linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "dmd", "the dlang linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "ldc2", "the dlang linker") - checker.toolchain_insert(toolchains, "dc-ld", "", "gdc", "the dlang linker") + checker.toolchain_insert(toolchains, "dc", "", "dmd", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc", "", "ldc2", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc", "", "gdc", "the dlang compiler") + checker.toolchain_insert(toolchains, "dc-ar", "", "dmd", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-ar", "", "ldc2", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-ar", "", "gdc", "the dlang static library archiver") + checker.toolchain_insert(toolchains, "dc-sh", "", "dmd", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-sh", "", "ldc2", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-sh", "", "gdc", "the dlang shared library linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "dmd", "the dlang linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "ldc2", "the dlang linker") + checker.toolchain_insert(toolchains, "dc-ld", "", "gdc", "the dlang linker") -- insert rust tools to toolchains - checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler") - checker.toolchain_insert(toolchains, "rc-ar", "", "rustc", "the rust static library archiver") - checker.toolchain_insert(toolchains, "rc-sh", "", "rustc", "the rust shared library linker") - checker.toolchain_insert(toolchains, "rc-ld", "", "rustc", "the rust linker") + checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler") + checker.toolchain_insert(toolchains, "rc-ar", "", "rustc", "the rust static library archiver") + checker.toolchain_insert(toolchains, "rc-sh", "", "rustc", "the rust shared library linker") + checker.toolchain_insert(toolchains, "rc-ld", "", "rustc", "the rust linker") -- insert asm tools to toolchains if config.get("arch"):find("64") then - checker.toolchain_insert(toolchains, "as", "", "ml64.exe", "the assember") + checker.toolchain_insert(toolchains, "as", "", "ml64.exe", "the assember") else - checker.toolchain_insert(toolchains, "as", "", "ml.exe", "the assember") + checker.toolchain_insert(toolchains, "as", "", "ml.exe", "the assember") end -- save toolchains |
