diff options
| -rw-r--r-- | xmake/core/base/interpreter.lua | 3 | ||||
| -rw-r--r-- | xmake/core/sandbox/modules/import/lib/detect/find_library.lua | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/xmake/core/base/interpreter.lua b/xmake/core/base/interpreter.lua index a22c35ed6..5c51b35e4 100644 --- a/xmake/core/base/interpreter.lua +++ b/xmake/core/base/interpreter.lua @@ -647,7 +647,8 @@ function interpreter:_script(script) script = function (...) -- import it - return import(modulename, {anonymous = true})(...) + _g._module = _g._module or import(modulename, {anonymous = true}) + return _g._module(...) end end diff --git a/xmake/core/sandbox/modules/import/lib/detect/find_library.lua b/xmake/core/sandbox/modules/import/lib/detect/find_library.lua index 732a24019..4b386f947 100644 --- a/xmake/core/sandbox/modules/import/lib/detect/find_library.lua +++ b/xmake/core/sandbox/modules/import/lib/detect/find_library.lua @@ -34,8 +34,10 @@ local target = require("project/target") local config = require("project/config") local raise = require("sandbox/modules/raise") local import = require("sandbox/modules/import") -local find_file = import("lib.detect.find_file", {anonymous = true}) -local find_pkg_config = import("detect.tool.find_pkg_config", {anonymous = true}) + +-- import sandbox modules +import("lib.detect.find_file") +import("detect.tool.find_pkg_config") -- get link name from the file name function sandbox_lib_detect_find_library._link(filename) |
