summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2017-09-14 00:47:01 +0800
committerruki <[email protected]>2017-09-13 22:42:08 +0800
commitb27b6447c072d357db96d17500c73bf9013b8c5c (patch)
tree1b98278958f103fd68d6a5eb83a6e3bf269082ea
parent5e42ccae1391c717e35f2ae5abe2edc038696c59 (diff)
fix yield directory bug
-rw-r--r--xmake/actions/require/install.lua2
-rw-r--r--xmake/core/sandbox/modules/import/lib/detect/find_program.lua2
-rw-r--r--xmake/modules/lib/detect/features.lua2
-rw-r--r--xmake/modules/lib/detect/has_flags.lua2
4 files changed, 7 insertions, 1 deletions
diff --git a/xmake/actions/require/install.lua b/xmake/actions/require/install.lua
index 9d635f135..fdf38f7c1 100644
--- a/xmake/actions/require/install.lua
+++ b/xmake/actions/require/install.lua
@@ -100,7 +100,7 @@ function main(requires)
-- avoid to run this task repeatly
if _g.installed then return end
- _g.installed = true
+ _g.installed = true
-- init requires
local requires_extra = nil
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 fa78c37af..b9c6cbf93 100644
--- a/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
+++ b/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
@@ -148,7 +148,9 @@ function sandbox_lib_detect_find_program.main(name, pathes, check)
local coroutine_running = coroutine.running()
if coroutine_running then
while checking ~= nil and checking == name do
+ local curdir = os.curdir()
coroutine.yield()
+ os.cd(curdir)
end
end
diff --git a/xmake/modules/lib/detect/features.lua b/xmake/modules/lib/detect/features.lua
index 313212924..507b44f26 100644
--- a/xmake/modules/lib/detect/features.lua
+++ b/xmake/modules/lib/detect/features.lua
@@ -64,7 +64,9 @@ function main(name, opt)
local coroutine_running = coroutine.running()
if coroutine_running then
while _g._checking ~= nil and _g._checking == key do
+ local curdir = os.curdir()
coroutine.yield()
+ os.cd(curdir)
end
end
diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua
index adf2c4adb..0957d554e 100644
--- a/xmake/modules/lib/detect/has_flags.lua
+++ b/xmake/modules/lib/detect/has_flags.lua
@@ -90,7 +90,9 @@ function main(name, flags, opt)
local coroutine_running = coroutine.running()
if coroutine_running then
while _g._checking ~= nil and _g._checking == key do
+ local curdir = os.curdir()
coroutine.yield()
+ os.cd(curdir)
end
end