diff options
| author | ruki <[email protected]> | 2023-09-15 11:38:46 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-09-15 11:38:46 +0800 |
| commit | 2b207492f61df550cf726ad059052b2d8062dbc8 (patch) | |
| tree | 7d3b5a04b7f4c7093d01c2bcd0c5747b992cf51d /xmake/rules/c++/modules/modules_support/gcc.lua | |
| parent | f17932e4261b76b9f5e6b3ab4564711332f7c077 (diff) | |
Update gcc.lua
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/gcc.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/gcc.lua | 14 |
1 files changed, 7 insertions, 7 deletions
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)) |
