diff options
| author | ruki <[email protected]> | 2023-09-13 22:55:52 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-09-13 22:55:52 +0800 |
| commit | ef4ac3071cd0cdb78bf947fa676f6863254238de (patch) | |
| tree | a5c2281454ee8d2b6c858dab32521e2c95505870 | |
| parent | 21293b83d75a21a58fa063579b160f21ffd864ac (diff) | |
fix add_moduledirs
| -rw-r--r-- | xmake/core/project/project.lua | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 3ac9ab7e2..e25d05f44 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -131,26 +131,37 @@ end -- add module directories function project._api_add_moduledirs(interp, ...) - sandbox_module.add_directories(...) + local scriptdir = project.interpreter():scriptdir() + for _, dir in ipairs({...}) do + if not path.is_absolute(dir) then + dir = path.absolute(dir, scriptdir) + end + sandbox_module.add_directories(dir) + end end -- add plugin directories load all plugins from the given directories function project._api_add_plugindirs(interp, ...) - - -- get all directories + local scriptdir = project.interpreter():scriptdir() local plugindirs = {} - local dirs = table.join(...) - for _, dir in ipairs(dirs) do + for _, dir in ipairs({...}) do + if not path.is_absolute(dir) then + dir = path.absolute(dir, scriptdir) + end table.insert(plugindirs, dir .. "/*") end - - -- add all plugins interp:api_builtin_includes(plugindirs) end -- add platform directories function project._api_add_platformdirs(interp, ...) - platform.add_directories(...) + local scriptdir = project.interpreter():scriptdir() + for _, dir in ipairs({...}) do + if not path.is_absolute(dir) then + dir = path.absolute(dir, scriptdir) + end + platform.add_directories(dir) + end end -- load the project file |
