summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-10 21:42:22 +0800
committerruki <[email protected]>2016-07-10 21:42:22 +0800
commit5299c28b6b886cc2294401ef9231bfc3d3b0c85a (patch)
tree865e967acd792557db4d85f63170d4e1998696f2
parentc0a237b461bb03a73f3ba93c1f6b1637f3d613ce (diff)
fix import rootdir bug
-rwxr-xr-xxmake/actions/build/kinds/binary.lua2
-rwxr-xr-xxmake/actions/build/kinds/shared.lua2
-rwxr-xr-xxmake/actions/build/kinds/static.lua2
-rw-r--r--xmake/core/sandbox/modules/import.lua2
-rw-r--r--xmake/core/sandbox/sandbox.lua4
5 files changed, 6 insertions, 6 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index aa4749869..ac5f0421f 100755
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -23,7 +23,7 @@
-- imports
import("core.base.option")
import("core.tool.linker")
-import("kinds.object")
+import("object")
-- build binary target
function build(target, g)
diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua
index b725d52dd..d9d333188 100755
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -23,7 +23,7 @@
-- imports
import("core.base.option")
import("core.tool.linker")
-import("kinds.object")
+import("object")
-- build binary target
function build(target, g)
diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua
index c159f327f..f1d3fdc07 100755
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -23,7 +23,7 @@
-- imports
import("core.base.option")
import("core.tool.archiver")
-import("kinds.object")
+import("object")
-- build binary target
function build(target, g)
diff --git a/xmake/core/sandbox/modules/import.lua b/xmake/core/sandbox/modules/import.lua
index 8aff5f3bd..03573baf9 100644
--- a/xmake/core/sandbox/modules/import.lua
+++ b/xmake/core/sandbox/modules/import.lua
@@ -64,7 +64,7 @@ function sandbox_import._loadfile(filepath, instance)
if instance then
-- fork a new sandbox for this script
- instance, errors = instance:fork(script)
+ instance, errors = instance:fork(script, path.directory(filepath))
if not instance then
return nil, errors
end
diff --git a/xmake/core/sandbox/sandbox.lua b/xmake/core/sandbox/sandbox.lua
index 64729bf7f..934f0019e 100644
--- a/xmake/core/sandbox/sandbox.lua
+++ b/xmake/core/sandbox/sandbox.lua
@@ -208,7 +208,7 @@ function sandbox.load(script, ...)
end
-- fork a new sandbox from the given sandbox
-function sandbox:fork(script)
+function sandbox:fork(script, rootdir)
-- no script?
if script == nil then
@@ -230,7 +230,7 @@ function sandbox:fork(script)
instance._PRIVATE._FILTER = self:filter()
-- inherit the root directory
- instance._PRIVATE._ROOTDIR = self:rootdir()
+ instance._PRIVATE._ROOTDIR = rootdir or self:rootdir()
-- bind public scope
setfenv(script, instance._PUBLIC)