diff options
| author | Arthur LAURENT <[email protected]> | 2022-08-02 18:20:20 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-08-02 18:20:20 +0200 |
| commit | 37af4ce4b13e5b7638fae804f967e28459626958 (patch) | |
| tree | 56673dde99016b8451005065c7b1309d404ffe1d | |
| parent | dee01ba2ff847c67d1da4b63565f6afe332a857c (diff) | |
[C++20 Modules] Remove add/remove_modulefiles
| -rw-r--r-- | xmake/core/project/target.lua | 106 | ||||
| -rw-r--r-- | xmake/languages/c++/load.lua | 1 | ||||
| -rw-r--r-- | xmake/languages/objc++/load.lua | 1 |
3 files changed, 0 insertions, 108 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 26223258c..b00cbe15a 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -1566,110 +1566,6 @@ function _instance:headerfiles(outputdir, opt) return srcheaders, dstheaders end --- get the module files -function _instance:modulefiles(outputdir) - local modules = self:get("modulefiles") - - -- get the installed module directory - local moduledir = outputdir - if not moduledir and self:installdir() then - path.join(self:installdir(), "include") - end - - -- get the extra information - local extrainfo = table.wrap(self:get("__extra_modulefiles")) - - -- get the source paths and destinate paths - local srcmodules = {} - local dstmodules = {} - local srcmodules_removed = {} - local removed_count = 0 - for _, module in ipairs(table.wrap(modules)) do - -- mark as removed files? - local removed = false - local prefix = "__remove_" - if module:startswith(prefix) then - module = module:sub(#prefix + 1) - removed = true - end - - -- get the root directory - local rootdir, count = module:gsub("|.*$", ""):gsub("%(.*%)$", "") - if count == 0 then - rootdir = nil - end - if rootdir and rootdir:trim() == "" then - rootdir = "." - end - - -- remove '(' and ')' first - local srcpaths = module:gsub("[%(%)]", "") - if srcpaths then - - -- get the source paths - srcpaths = os.match(srcpaths) - if srcpaths then - if removed then - removed_count = removed_count + #srcpaths - table.join2(srcmodules_removed, srcpaths) - else - -- add the source modules - table.join2(srcmodules, srcpaths) - - -- get the destinate directories if the install directory exists - if moduledir then - local prefixdir = (extrainfo[module] or {}).prefixdir - for _, srcpath in ipairs(srcpaths) do - local dstdir = moduledir - if prefixdir then - dstdir = path.join(dstdir, prefixdir) - end - local dstmodule = nil - if rootdir then - dstmodule = path.absolute(path.relative(srcpath, rootdir), dstdir) - else - dstmodule = path.join(dstdir, path.filename(srcpath)) - end - table.insert(dstmodules, dstmodule) - end - end - end - end - end - end - - -- remove all module files which need be removed - if removed_count > 0 then - table.remove_if(srcmodules, function (i, srcmodule) - for _, removed_file in ipairs(srcmodules_removed) do - local pattern = path.translate(removed_file:gsub("|.*$", "")) - if pattern:sub(1, 2):find('%.[/\\]') then - pattern = pattern:sub(3) - end - pattern = path.pattern(pattern) - if srcmodule:match(pattern) then - if i <= #dstmodules then - table.remove(dstmodules, i) - end - return true - end - end - end) - end - - return srcmodules, dstmodules -end - --- get the bmi files -function _instance:bmifiles(outputdir) - local compilerinst = self:compiler() - - -- get the installed bmi directory - local bmidir = bmi_outputdir or path.join(self:installdir(), "lib", compilerinst:name() + "-" + compilerinst:version()) - - return self:_copiedfiles("bmifiles", bmidir) -end - -- get the configuration files function _instance:configfiles(outputdir) return self:_copiedfiles("configfiles", outputdir or self:configdir(), function (dstpath, fileinfo) @@ -2249,7 +2145,6 @@ function target.apis() , "target.set_rundir" -- target.add_xxx , "target.add_files" - , "target.add_modulefiles" , "target.add_cleanfiles" , "target.add_configfiles" , "target.add_installfiles" @@ -2258,7 +2153,6 @@ function target.apis() -- target.remove_xxx , "target.remove_files" , "target.remove_headerfiles" - , "target.remove_modulefiles" } , dictionary = { diff --git a/xmake/languages/c++/load.lua b/xmake/languages/c++/load.lua index b3c2b2ae3..16380ab3c 100644 --- a/xmake/languages/c++/load.lua +++ b/xmake/languages/c++/load.lua @@ -224,7 +224,6 @@ function _get_apis() -- target.add_xxx , "target.add_headers" -- TODO deprecated , "target.add_headerfiles" - , "target.add_modulefiles" , "target.add_linkdirs" , "target.add_includedirs" , "target.add_sysincludedirs" diff --git a/xmake/languages/objc++/load.lua b/xmake/languages/objc++/load.lua index 2950a28f6..85df22850 100644 --- a/xmake/languages/objc++/load.lua +++ b/xmake/languages/objc++/load.lua @@ -80,7 +80,6 @@ function _get_apis() -- target.add_xxx , "target.add_headers" -- TODO deprecated , "target.add_headerfiles" - , "target.add_modulefiles" , "target.add_linkdirs" , "target.add_includedirs" , "target.add_sysincludedirs" |
