summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-14 23:50:14 +0800
committerruki <[email protected]>2018-11-14 17:01:26 +0800
commit1feb7be8eca85f724b52fa875951179c52f9d018 (patch)
tree1f0ed781894784c33e914bb39561528daeb57565
parenta4b58d86da4cf3df4aeae5f390eaa1b69b8fffe8 (diff)
check gcc.cmd for android ndk on windows
-rw-r--r--xmake/core/base/os.lua6
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/find_program.lua6
-rw-r--r--xmake/platforms/android/check.lua9
3 files changed, 17 insertions, 4 deletions
diff --git a/xmake/core/base/os.lua b/xmake/core/base/os.lua
index ef9455955..cad001996 100644
--- a/xmake/core/base/os.lua
+++ b/xmake/core/base/os.lua
@@ -718,8 +718,10 @@ function os.isexec(filepath)
-- check permission
-- is *.exe for windows?
- if os.host() == "windows" and not filepath:find("%.exe") then
- filepath = filepath .. ".exe"
+ if os.host() == "windows" then
+ if not filepath:endswith(".exe") and not filepath:endswith(".cmd") and not filepath:endswith(".bat") then
+ filepath = filepath .. ".exe"
+ end
end
-- file exists?
diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
index c5690dd3c..9bab776ad 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
@@ -45,8 +45,10 @@ local checking = nil
function sandbox_lib_detect_find_program._check(program, opt)
-- is *.exe for windows?
- if os.host() == "windows" and not program:find("%.exe") then
- program = program .. ".exe"
+ if os.host() == "windows" then
+ if not program:endswith(".exe") and not program:endswith(".cmd") and not program:endswith(".bat") then
+ program = program .. ".exe"
+ end
end
-- do not attempt to run program? check it fastly
diff --git a/xmake/platforms/android/check.lua b/xmake/platforms/android/check.lua
index cd4c8b786..7c1fa50b4 100644
--- a/xmake/platforms/android/check.lua
+++ b/xmake/platforms/android/check.lua
@@ -69,6 +69,15 @@ function _toolchains(config)
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")
+ if is_host("windows") then
+ checker.toolchain_insert(toolchains, "cc", cross, "gcc.cmd", "the c compiler")
+ checker.toolchain_insert(toolchains, "cxx", cross, "g++.cmd", "the c++ compiler")
+ checker.toolchain_insert(toolchains, "as", cross, "gcc.cmd", "the assember")
+ checker.toolchain_insert(toolchains, "ld", cross, "g++.cmd", "the linker")
+ checker.toolchain_insert(toolchains, "ld", cross, "gcc.cmd", "the linker")
+ checker.toolchain_insert(toolchains, "sh", cross, "g++.cmd", "the shared library linker")
+ checker.toolchain_insert(toolchains, "sh", cross, "gcc.cmd", "the shared library linker")
+ end
-- insert rust tools to toolchains
checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler")