From f17932e4261b76b9f5e6b3ab4564711332f7c077 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 15 Sep 2023 11:17:12 +0800 Subject: Update gcc.lua --- xmake/rules/c++/modules/modules_support/gcc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua') diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index 4fa92e4df..51d62d78d 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -514,7 +514,7 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op local flags = {"-x", "c++", "-c", path(cppfile), "-o", path(objectfile)} batchcmds:show_progress(opt.progress, "${color.build.object}compiling.module.$(mode) %s", name or cppfile) batchcmds:mkdir(path.directory(objectfile)) - _batchcmds_compile(batchcmds, target, flags) + _batchcmds_compile(batchcmds, target, flags, cppfile) batchcmds:add_depfiles(cppfile) target:add("objectfiles", objectfile) if provide then -- cgit v1.3.1 From 2b207492f61df550cf726ad059052b2d8062dbc8 Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 15 Sep 2023 11:38:46 +0800 Subject: Update gcc.lua --- xmake/rules/c++/modules/modules_support/gcc.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua') diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index 51d62d78d..f08eb4199 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -511,13 +511,13 @@ function build_modules_for_batchcmds(target, batchcmds, objectfiles, modules, op break end end - local flags = {"-x", "c++", "-c", path(cppfile), "-o", path(objectfile)} - batchcmds:show_progress(opt.progress, "${color.build.object}compiling.module.$(mode) %s", name or cppfile) - batchcmds:mkdir(path.directory(objectfile)) - _batchcmds_compile(batchcmds, target, flags, cppfile) - batchcmds:add_depfiles(cppfile) - target:add("objectfiles", objectfile) - if provide then + if provide or common.has_module_extension(cppfile) then + local flags = {"-x", "c++", "-c", path(cppfile), "-o", path(objectfile)} + batchcmds:show_progress(opt.progress, "${color.build.object}compiling.module.$(mode) %s", name or cppfile) + batchcmds:mkdir(path.directory(objectfile)) + _batchcmds_compile(batchcmds, target, flags, cppfile) + batchcmds:add_depfiles(cppfile) + target:add("objectfiles", objectfile) _add_module_to_mapper(mapper_file, name, path.absolute(provide.bmi, projectdir)) end depmtime = math.max(depmtime, os.mtime(provide and provide.bmi or objectfile)) -- cgit v1.3.1 From 3f10a225581a76e8219c779518697507c9ab38de Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 15 Sep 2023 11:54:05 +0800 Subject: Update gcc.lua --- xmake/rules/c++/modules/modules_support/gcc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua') diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua index f08eb4199..762810f08 100644 --- a/xmake/rules/c++/modules/modules_support/gcc.lua +++ b/xmake/rules/c++/modules/modules_support/gcc.lua @@ -113,7 +113,7 @@ end -- @note we need to use batchcmds:compilev to translate paths in compflags for generator, e.g. -Ixx function _batchcmds_compile(batchcmds, target, flags, sourcefile) local compinst = target:compiler("cxx") - local compflags = compinst:compflags({sourcefile = sourcefile}, {target = target}) + local compflags = compinst:compflags({sourcefile = sourcefile, target = target}) batchcmds:compilev(table.join(compflags or {}, flags), {compiler = compinst, sourcekind = "cxx"}) end -- cgit v1.3.1