From d978d57e5a5c1ea55bf328888fa38f7a4a9dad8e Mon Sep 17 00:00:00 2001 From: Gly Date: Wed, 13 Sep 2023 19:09:13 +0200 Subject: add requires flags to module in build_modules_for_batchcmds --- xmake/rules/c++/modules/modules_support/clang.lua | 2 ++ xmake/rules/c++/modules/modules_support/msvc.lua | 2 ++ 2 files changed, 4 insertions(+) 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 -- cgit v1.3.1