summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules
diff options
context:
space:
mode:
authorGly <[email protected]>2023-09-13 19:07:22 +0200
committerGly <[email protected]>2023-09-13 19:07:22 +0200
commit9e0fdd520ddabedc8ae4d2c17cbd66db698afaa5 (patch)
tree0c901bd82b7dba57c922a5d3116d75799af293fe /xmake/rules/c++/modules
parent1d55d00c22cde3f5b7cf7b7ee7a42fb477298856 (diff)
Remove before_buildcmd_files from c++.build.modules
Diffstat (limited to 'xmake/rules/c++/modules')
-rw-r--r--xmake/rules/c++/modules/xmake.lua48
1 files changed, 0 insertions, 48 deletions
diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua
index 9155f1a6f..ab90f67a7 100644
--- a/xmake/rules/c++/modules/xmake.lua
+++ b/xmake/rules/c++/modules/xmake.lua
@@ -57,54 +57,6 @@ rule("c++.build.modules")
target:data_set("cxx.has_modules", true)
end
end)
- before_buildcmd_files(function(target, batchcmds, sourcebatch, opt)
- if target:data("cxx.has_modules") then
- import("modules_support.common")
-
- local target_clone = target:clone()
-
- common.patch_sourcebatch(target_clone, sourcebatch, opt)
-
- local modules = common.get_module_dependencies(target, sourcebatch, opt)
-
- -- we need to generate modules to get their dependencies available for `get_requiresflags`
- common.generate_headerunits_for_batchcmds(target_clone, batchcmds, sourcebatch, modules, opt)
- common.build_modules_for_batchcmds(target_clone, batchcmds, sourcebatch, modules, opt)
-
- -- for each module, we add required flags
- local module_support = common.modules_support(target)
- for _, objectfile in ipairs(sourcebatch.objectfiles) do
- local module = modules[objectfile]
- if module and module.requires then
- local requiresflags = module_support.get_requiresflags(target, module.requires)
-
- local sourcefile = nil
- for _, mod in pairs(module.provides) do
- if mod.sourcefile then
- sourcefile = mod.sourcefile
- break
- end
- end
- if sourcefile then
- target:fileconfig_add(sourcefile, {force = {cxxflags = requiresflags}})
- end
- end
- end
-
- -- debugging values
- local compinst = target:compiler("cxx")
- for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
- local compflags = compinst:compflags({sourcefile = sourcefile, target = target})
- print("source: ", sourcefile, "compflags: ", compflags)
- end
- local compflags = compinst:compflags({sourcefile = "src/main.cpp", target = target})
- print("source: ", "src/main.cpp", "compflags: ", compflags)
-
- else
- -- avoid duplicate linking of object files of non-module programs
- sourcebatch.objectfiles = {}
- end
- end)
-- build modules
rule("c++.build.modules.builder")