summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support
diff options
context:
space:
mode:
authorGly <[email protected]>2023-09-13 19:09:13 +0200
committerGly <[email protected]>2023-09-13 19:09:13 +0200
commitd978d57e5a5c1ea55bf328888fa38f7a4a9dad8e (patch)
tree9828870f9679b196c2448b4aa7db1a9edf2b5d6b /xmake/rules/c++/modules/modules_support
parent9e0fdd520ddabedc8ae4d2c17cbd66db698afaa5 (diff)
add requires flags to module in build_modules_for_batchcmds
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua2
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc.lua2
2 files changed, 4 insertions, 0 deletions
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index 32cdc4d4f..1254aa29a 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -711,6 +711,8 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op
_batchcmds_compile(batchcmds, target, table.join(flags,
{"-x", "c++-module", "--precompile", "-c", path(cppfile), "-o", path(provide.bmi)}))
_add_module_to_mapper(target, name, provide.bmi, {namedmodule = true})
+ -- add requiresflags to module. it will be used for project generation
+ target:fileconfig_add(cppfile, {force = {cxxflags = requiresflags}})
end
_batchcmds_compile(batchcmds, target, file, table.join(flags,
not provide and {"-x", "c++"} or {}, {"-c", file, "-o", path(objectfile)}))
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua
index 0643117d0..e90ae3df3 100644
--- a/xmake/rules/c++/modules/modules_support/msvc.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc.lua
@@ -557,6 +557,8 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op
_add_objectfile_to_link_arguments(target, path.translate(objectfile))
if provide then
_add_module_to_mapper(target, referenceflag, name, name, objectfile, provide.bmi, requiresflags)
+ -- add requiresflags to module. it will be used for project generation
+ target:fileconfig_add(cppfile, {force = {cxxflags = requiresflags}})
end
depmtime = math.max(depmtime, os.mtime(provide and provide.bmi or objectfile))
elseif requiresflags then