Skip to content

Commit

Permalink
use extraconf
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Mar 14, 2024
1 parent ff083f9 commit a67fb63
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions xmake/core/project/target.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function _instance:_copiedfiles(filetype, outputdir, pathfilter)
if not copiedfiles then return end

-- get the extra information
local extrainfo = table.wrap(self:get("__extra_" .. filetype))
local extrainfo = table.wrap(self:extraconf(filetype))

-- get the source paths and destinate paths
local srcfiles = {}
Expand Down Expand Up @@ -1403,7 +1403,7 @@ end

-- get the config info of the given package
function _instance:pkgconfig(pkgname)
local extra_packages = self:get("__extra_packages")
local extra_packages = self:extraconf("packages")
if extra_packages then
return extra_packages[pkgname]
end
Expand Down Expand Up @@ -1773,12 +1773,10 @@ end

-- get the config info of the given source file
function _instance:fileconfig(sourcefile)

-- get files config
local filesconfig = self._FILESCONFIG
if not filesconfig then
filesconfig = {}
for filepath, fileconfig in pairs(table.wrap(self:get("__extra_files"))) do
for filepath, fileconfig in pairs(table.wrap(self:extraconf("files"))) do

-- match source files
local results = os.match(filepath)
Expand All @@ -1801,8 +1799,6 @@ function _instance:fileconfig(sourcefile)
end
self._FILESCONFIG = filesconfig
end

-- get file config
return filesconfig[sourcefile]
end

Expand Down Expand Up @@ -2055,7 +2051,7 @@ function _instance:headerfiles(outputdir, opt)
end

-- get the extra information
local extrainfo = table.wrap(self:get("__extra_headerfiles"))
local extrainfo = table.wrap(self:extraconf("headerfiles"))

-- get the source paths and destinate paths
local srcheaders = {}
Expand Down

0 comments on commit a67fb63

Please sign in to comment.