diff options
| author | ruki <[email protected]> | 2017-03-31 14:24:01 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-03-31 14:24:01 +0800 |
| commit | a71627d9ebff57e3fa5e36c2c8418a0eb91b6a52 (patch) | |
| tree | 476d9f02de019ebdf4511c9c0f0121c9354cfb08 | |
| parent | 6e6a50d05f428e408af6f9dd9a80d99b8e8e7e0e (diff) | |
fix windows checker
| -rw-r--r-- | xmake/platforms/windows/check.lua | 99 |
1 files changed, 52 insertions, 47 deletions
diff --git a/xmake/platforms/windows/check.lua b/xmake/platforms/windows/check.lua index 9b4fb9770..5457cc37d 100644 --- a/xmake/platforms/windows/check.lua +++ b/xmake/platforms/windows/check.lua @@ -265,62 +265,51 @@ function _toolchains(config) return _g.TOOLCHAINS end - -- apply vs envirnoment (maybe config.arch has been updated) - if not _apply_vsenv(config, config.get("vs")) then - return - end - -- init toolchains local toolchains = {} - -- enter environment - environment.enter("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, "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 asm tools to toolchains - if config.get("arch"):find("64") then - checker.toolchain_insert(toolchains, "as", "", "ml64.exe", "the assember") - else - checker.toolchain_insert(toolchains, "as", "", "ml.exe", "the assember") - end - - -- leave environment - environment.leave("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, "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") + else + checker.toolchain_insert(toolchains, "as", "", "ml.exe", "the assember") + end -- save toolchains _g.TOOLCHAINS = toolchains @@ -334,7 +323,23 @@ function main(kind, toolkind) -- only check the given tool? if toolkind then - return checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains) + + -- apply vs envirnoment (maybe config.arch has been updated) + if not _apply_vsenv(config, config.get("vs")) then + return + end + + -- enter environment + environment.enter("toolchains") + + -- check it + checker.toolchain_check(import("core.project." .. kind), toolkind, _toolchains) + + -- leave environment + environment.leave("toolchains") + + -- end + return end -- init the check list of config |
