diff options
| author | ruki <[email protected]> | 2019-02-10 21:58:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-02-10 21:58:20 +0800 |
| commit | bf9ff509bfc2b41e740d251c46c056e9101da86f (patch) | |
| tree | 3c57a699da8c8b5c466ab5313ff7468c38454cf1 | |
| parent | f67df69a4cd4434784ce6b963824c8f562393210 (diff) | |
fix load packages bug
| -rw-r--r-- | xmake/core/project/project.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index d2e94516e..b4a024d3f 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -554,8 +554,8 @@ function project._load_options(disable_filter) return {}, nil end - -- load the project file first if has not been loaded? - local ok, errors = project._load() + -- reload the project file to ensure `if is_plat() then add_packagedirs() end` works + local ok, errors = project._load(true) if not ok then return nil, errors end @@ -591,10 +591,10 @@ function project._load_options(disable_filter) local linkdirs = {} local includedirs = {} for _, linkdir in ipairs(table.wrap(packageinfo.linkdirs)) do - table.insert(linkdirs, path.join(rootdir, linkdir)) + table.insert(linkdirs, path.is_absolute(linkdir) and linkdir or path.join(rootdir, linkdir)) end for _, includedir in ipairs(table.wrap(packageinfo.includedirs)) do - table.insert(includedirs, path.join(rootdir, includedir)) + table.insert(includedirs, path.is_absolute(includedir) and includedir or path.join(rootdir, includedir)) end if #linkdirs > 0 then packageinfo.linkdirs = linkdirs |
