diff options
| author | ruki <[email protected]> | 2017-02-22 21:51:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-22 21:51:00 +0800 |
| commit | 4d6a57bfa24a9e0c8a35b18ba69face0d66c1a75 (patch) | |
| tree | cc54ed7113dac352c102dc6a2d44f9711d98cc9c | |
| parent | b69ebb909d9f62f1300d75067938e98d4d7ae36a (diff) | |
improve check for iphoneos and watchos
| -rw-r--r-- | xmake/platforms/iphoneos/check.lua | 56 | ||||
| -rw-r--r-- | xmake/platforms/macosx/check.lua | 2 | ||||
| -rw-r--r-- | xmake/platforms/watchos/check.lua | 56 |
3 files changed, 47 insertions, 67 deletions
diff --git a/xmake/platforms/iphoneos/check.lua b/xmake/platforms/iphoneos/check.lua index 973b96870..3292199d4 100644 --- a/xmake/platforms/iphoneos/check.lua +++ b/xmake/platforms/iphoneos/check.lua @@ -50,44 +50,34 @@ function _check_toolchains(config) -- init cross local cross = ifelse(simulator, "xcrun -sdk iphonesimulator ", "xcrun -sdk iphoneos ") - -- iphoneos or iphonesimulator? + -- check for c/c++ tools + checker.check_toolchain(config, "cc", cross, "clang", "the c compiler") + checker.check_toolchain(config, "cxx", cross, "clang", "the c++ compiler") + checker.check_toolchain(config, "cxx", cross, "clang++", "the c++ compiler") + checker.check_toolchain(config, "ld", cross, "clang++", "the linker") + checker.check_toolchain(config, "ld", cross, "clang", "the linker") + checker.check_toolchain(config, "ar", cross, "ar", "the static library archiver") + checker.check_toolchain(config, "ex", cross, "ar", "the static library extractor") + checker.check_toolchain(config, "sh", cross, "clang++", "the shared library linker") + checker.check_toolchain(config, "sh", cross, "clang", "the shared library linker") + checker.check_toolchain(config, "dg", cross, "lldb", "the debugger") + + -- check for objc/c++ tools + checker.check_toolchain(config, "mm", cross, "clang", "the objc compiler") + checker.check_toolchain(config, "mxx", cross, "clang++", "the objc++ compiler") + checker.check_toolchain(config, "mxx", cross, "clang", "the objc++ compiler") + + -- check for asm tools if simulator then - checker.check_toolchain(config, "cc", "xcrun -sdk iphonesimulator ", "clang", "the c compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk iphonesimulator ", "clang", "the c++ compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk iphonesimulator ", "clang++", "the c++ compiler") - checker.check_toolchain(config, "mm", "xcrun -sdk iphonesimulator ", "clang", "the objc compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk iphonesimulator ", "clang++", "the objc++ compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk iphonesimulator ", "clang", "the objc++ compiler") - checker.check_toolchain(config, "as", "xcrun -sdk iphonesimulator ", "clang", "the assember") - checker.check_toolchain(config, "ld", "xcrun -sdk iphonesimulator ", "clang++", "the linker") - checker.check_toolchain(config, "ld", "xcrun -sdk iphonesimulator ", "clang", "the linker") - checker.check_toolchain(config, "ar", "xcrun -sdk iphonesimulator ", "ar", "the static library archiver") - checker.check_toolchain(config, "ex", "xcrun -sdk iphonesimulator ", "ar", "the static library extractor") - checker.check_toolchain(config, "sh", "xcrun -sdk iphonesimulator ", "clang++", "the shared library linker") - checker.check_toolchain(config, "sh", "xcrun -sdk iphonesimulator ", "clang", "the shared library linker") + checker.check_toolchain(config, "as", cross, "clang", "the assember") else - checker.check_toolchain(config, "cc", "xcrun -sdk iphoneos ", "clang", "the c compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk iphoneos ", "clang", "the c++ compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk iphoneos ", "clang++", "the c++ compiler") - checker.check_toolchain(config, "mm", "xcrun -sdk iphoneos ", "clang", "the objc compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk iphoneos ", "clang++", "the objc++ compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk iphoneos ", "clang", "the objc++ compiler") - checker.check_toolchain(config, "as", path.join(os.toolsdir(), "utils/gas-preprocessor.pl xcrun -sdk iphoneos "), "clang", "the assember", _check_as) - checker.check_toolchain(config, "ld", "xcrun -sdk iphoneos ", "clang++", "the linker") - checker.check_toolchain(config, "ld", "xcrun -sdk iphoneos ", "clang", "the linker") - checker.check_toolchain(config, "ar", "xcrun -sdk iphoneos ", "ar", "the static library archiver") - checker.check_toolchain(config, "ex", "xcrun -sdk iphoneos ", "ar", "the static library extractor") - checker.check_toolchain(config, "sh", "xcrun -sdk iphoneos ", "clang++", "the shared library linker") - checker.check_toolchain(config, "sh", "xcrun -sdk iphoneos ", "clang", "the shared library linker") + checker.check_toolchain(config, "as", path.join(os.toolsdir(), "utils/gas-preprocessor.pl " .. cross), "clang", "the assember", _check_as) end -- check for swift tools - checker.check_toolchain_from_env(config, "sc", "SC", "the swift compiler") - checker.check_toolchain(config, "sc", cross, "swiftc", "the swift compiler") - checker.check_toolchain_from_env(config, "sc-ld", "SC", "the swift linker") - checker.check_toolchain(config, "sc-ld", cross, "swiftc", "the swift linker") - checker.check_toolchain_from_env(config, "sc-sh", "SC", "the swift shared library linker") - checker.check_toolchain(config, "sc-sh", cross, "swiftc", "the swift shared library linker") + checker.check_toolchain(config, "sc", cross, "swiftc", "the swift compiler") + checker.check_toolchain(config, "sc-ld", cross, "swiftc", "the swift linker") + checker.check_toolchain(config, "sc-sh", cross, "swiftc", "the swift shared library linker") end -- check it diff --git a/xmake/platforms/macosx/check.lua b/xmake/platforms/macosx/check.lua index abde4ca4f..91c18a055 100644 --- a/xmake/platforms/macosx/check.lua +++ b/xmake/platforms/macosx/check.lua @@ -31,7 +31,7 @@ function _check_toolchains(config) -- check for c/c++ tools checker.check_toolchain(config, "cc", "xcrun -sdk macosx ", "clang", "the c compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk macosx ", "clang", "the c++ compiler") + checker.check_toolchain(config, "cxx", "xcrun -sdk macosx ", "clang", "the c++ compiler") checker.check_toolchain(config, "cxx", "xcrun -sdk macosx ", "clang++", "the c++ compiler") checker.check_toolchain(config, "ld", "xcrun -sdk macosx ", "clang++", "the linker") checker.check_toolchain(config, "ld", "xcrun -sdk macosx ", "clang", "the linker") diff --git a/xmake/platforms/watchos/check.lua b/xmake/platforms/watchos/check.lua index 9da3452ff..f22ec4dd5 100644 --- a/xmake/platforms/watchos/check.lua +++ b/xmake/platforms/watchos/check.lua @@ -50,44 +50,34 @@ function _check_toolchains(config) -- init cross local cross = ifelse(simulator, "xcrun -sdk watchsimulator ", "xcrun -sdk watchos ") - -- watchos or watchsimulator? + -- check for c/c++ tools + checker.check_toolchain(config, "cc", cross, "clang", "the c compiler") + checker.check_toolchain(config, "cxx", cross, "clang", "the c++ compiler") + checker.check_toolchain(config, "cxx", cross, "clang++", "the c++ compiler") + checker.check_toolchain(config, "ld", cross, "clang++", "the linker") + checker.check_toolchain(config, "ld", cross, "clang", "the linker") + checker.check_toolchain(config, "ar", cross, "ar", "the static library archiver") + checker.check_toolchain(config, "ex", cross, "ar", "the static library extractor") + checker.check_toolchain(config, "sh", cross, "clang++", "the shared library linker") + checker.check_toolchain(config, "sh", cross, "clang", "the shared library linker") + checker.check_toolchain(config, "dg", cross, "lldb", "the debugger") + + -- check for objc/c++ tools + checker.check_toolchain(config, "mm", cross, "clang", "the objc compiler") + checker.check_toolchain(config, "mxx", cross, "clang++", "the objc++ compiler") + checker.check_toolchain(config, "mxx", cross, "clang", "the objc++ compiler") + + -- check for asm tools if simulator then - checker.check_toolchain(config, "cc", "xcrun -sdk watchsimulator ", "clang", "the c compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk watchsimulator ", "clang", "the c++ compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk watchsimulator ", "clang++", "the c++ compiler") - checker.check_toolchain(config, "mm", "xcrun -sdk watchsimulator ", "clang", "the objc compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk watchsimulator ", "clang++", "the objc++ compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk watchsimulator ", "clang", "the objc++ compiler") - checker.check_toolchain(config, "as", "xcrun -sdk watchsimulator ", "clang", "the assember") - checker.check_toolchain(config, "ld", "xcrun -sdk watchsimulator ", "clang++", "the linker") - checker.check_toolchain(config, "ld", "xcrun -sdk watchsimulator ", "clang", "the linker") - checker.check_toolchain(config, "ar", "xcrun -sdk watchsimulator ", "ar", "the static library archiver") - checker.check_toolchain(config, "ex", "xcrun -sdk watchsimulator ", "ar", "the static library extractor") - checker.check_toolchain(config, "sh", "xcrun -sdk watchsimulator ", "clang++", "the shared library linker") - checker.check_toolchain(config, "sh", "xcrun -sdk watchsimulator ", "clang", "the shared library linker") + checker.check_toolchain(config, "as", cross, "clang", "the assember") else - checker.check_toolchain(config, "cc", "xcrun -sdk watchos ", "clang", "the c compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk watchos ", "clang", "the c++ compiler") - checker.check_toolchain(config, "cxx", "xcrun -sdk watchos ", "clang++", "the c++ compiler") - checker.check_toolchain(config, "mm", "xcrun -sdk watchos ", "clang", "the objc compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk watchos ", "clang++", "the objc++ compiler") - checker.check_toolchain(config, "mxx", "xcrun -sdk watchos ", "clang", "the objc++ compiler") - checker.check_toolchain(config, "as", path.join(os.toolsdir(), "utils/gas-preprocessor.pl xcrun -sdk watchos "), "clang", "the assember", _check_as) - checker.check_toolchain(config, "ld", "xcrun -sdk watchos ", "clang++", "the linker") - checker.check_toolchain(config, "ld", "xcrun -sdk watchos ", "clang", "the linker") - checker.check_toolchain(config, "ar", "xcrun -sdk watchos ", "ar", "the static library archiver") - checker.check_toolchain(config, "ex", "xcrun -sdk watchos ", "ar", "the static library extractor") - checker.check_toolchain(config, "sh", "xcrun -sdk watchos ", "clang++", "the shared library linker") - checker.check_toolchain(config, "sh", "xcrun -sdk watchos ", "clang", "the shared library linker") + checker.check_toolchain(config, "as", path.join(os.toolsdir(), "utils/gas-preprocessor.pl " .. cross), "clang", "the assember", _check_as) end -- check for swift tools - checker.check_toolchain_from_env(config, "sc", "SC", "the swift compiler") - checker.check_toolchain(config, "sc", cross, "swiftc", "the swift compiler") - checker.check_toolchain_from_env(config, "sc-ld", "SC", "the swift linker") - checker.check_toolchain(config, "sc-ld", cross, "swiftc", "the swift linker") - checker.check_toolchain_from_env(config, "sc-sh", "SC", "the swift shared library linker") - checker.check_toolchain(config, "sc-sh", cross, "swiftc", "the swift shared library linker") + checker.check_toolchain(config, "sc", cross, "swiftc", "the swift compiler") + checker.check_toolchain(config, "sc-ld", cross, "swiftc", "the swift linker") + checker.check_toolchain(config, "sc-sh", cross, "swiftc", "the swift shared library linker") end -- check it |
