summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-15 22:47:15 +0800
committerruki <[email protected]>2018-11-15 10:43:34 +0800
commit8db3d73f344627155ad4796a0395b8f9df182e20 (patch)
tree262426f6237a980075582f44763eac8cfd7e6d76
parentfa3a775ce5ba2320f6bba4386db2428a77151374 (diff)
add llvm-ar to android
-rw-r--r--xmake/core/platform/environment.lua13
-rw-r--r--xmake/platforms/android/check.lua2
-rw-r--r--xmake/platforms/windows/environment.lua9
3 files changed, 15 insertions, 9 deletions
diff --git a/xmake/core/platform/environment.lua b/xmake/core/platform/environment.lua
index c9dd2415f..654d4bc1a 100644
--- a/xmake/core/platform/environment.lua
+++ b/xmake/core/platform/environment.lua
@@ -27,9 +27,11 @@ local environment = environment or {}
-- load modules
local os = require("base/os")
+local global = require("base/global")
local platform = require("platform/platform")
local sandbox = require("sandbox/sandbox")
local package = require("package/package")
+local import = require("sandbox/modules/import")
-- enter the toolchains environment
function environment._enter_toolchains()
@@ -50,6 +52,17 @@ function environment._enter_toolchains()
os.addenv("PATH", path.join(localdir, dir))
end
os.addenv("PATH", path.join(localdir, "bin"))
+
+ -- add $programdir/winenv/bin to $path
+ if os.host() == "windows" then
+ os.addenv("PATH", path.join(os.programdir(), "winenv", "bin"))
+
+ -- attempt to load winenv
+ local winenv_dir = path.join(global.directory(), "winenv")
+ if os.isdir(winenv_dir) then
+ import("winenv", {rootdir = winenv_dir, try = true, anonymous = true})(winenv_dir)
+ end
+ end
end
-- leave the toolchains environment
diff --git a/xmake/platforms/android/check.lua b/xmake/platforms/android/check.lua
index d2eafb583..b33bdcf5f 100644
--- a/xmake/platforms/android/check.lua
+++ b/xmake/platforms/android/check.lua
@@ -77,6 +77,8 @@ function _toolchains(config)
checker.toolchain_insert(toolchains, "ld", "", "clang", "the linker")
checker.toolchain_insert(toolchains, "sh", "", "clang++", "the shared library linker")
checker.toolchain_insert(toolchains, "sh", "", "clang", "the shared library linker")
+ checker.toolchain_insert(toolchains, "ar", "", "llvm-ar", "the static library archiver")
+ checker.toolchain_insert(toolchains, "ex", "", "llvm-ar", "the static library extractor")
-- insert rust tools to toolchains
checker.toolchain_insert(toolchains, "rc", "", "rustc", "the rust compiler")
diff --git a/xmake/platforms/windows/environment.lua b/xmake/platforms/windows/environment.lua
index 426b9b4ee..e1c37f7d8 100644
--- a/xmake/platforms/windows/environment.lua
+++ b/xmake/platforms/windows/environment.lua
@@ -77,15 +77,6 @@ function _enter_toolchains()
_g.libs = _enter("lib")
_g.includes = _enter("include")
_g.libpathes = _enter("libpath")
-
- -- add $programdir/winenv/bin to $path
- os.addenv("path", path.join(os.programdir(), "winenv", "bin"))
-
- -- attempt to load winenv
- local winenv_dir = path.join(global.directory(), "winenv")
- if os.isdir(winenv_dir) then
- import("winenv", {rootdir = winenv_dir, try = true, anonymous = true})(winenv_dir)
- end
end
-- leave the toolchains environment